﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » BO translation and subclassing</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 08 Apr 2026 14:21:47 GMT</lastBuildDate><ttl>20</ttl><item><title>BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27215.aspx</link><description>Hi, I have an environment&lt;br&gt;
Step1.&lt;br&gt;
[UserControl1 (based on SF userControl)&lt;br&gt;
 _|___ UserControl2 (based on SF userControl)&lt;br&gt;
 _|_________|____ BO2&lt;br&gt;
 _|___BO1&lt;br&gt;
&lt;br&gt;
Between BO1 and BO2 I have translation.&lt;br&gt;
&lt;br&gt;
Step2.&lt;br&gt;
[Form]&lt;br&gt;
__|___ UserControl1&lt;br&gt;
__|________|___ BO1&lt;br&gt;
__|__BO0&lt;br&gt;
&lt;br&gt;
Between BO0 and BO1 I have translation.&lt;br&gt;
&lt;br&gt;
This combination works perfect.&lt;br&gt;
&lt;br&gt;
Step3.&lt;br&gt;
I create UserControl3 based on UserControl1 !!!&lt;br&gt;
When form starts I'v got an error message now. (below)&lt;br&gt;
It seems in subclassing my BO translation lost. I try to make BO as Public but it does not help.&lt;br&gt;
Any idea?&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
BusinessLayerException&lt;br&gt;
  The business object [BO1] could not be located.  It is most likely this object was deleted or renamed.&lt;br&gt;
&lt;br&gt;
Source     : MicroFour StrataFrame UI&lt;br&gt;
&lt;br&gt;
Stack Trace: &lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.GetBusinessObject(ContainerControl ParentControl, String BusinessObjectName)&lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.TranslateBusinessObjects(BusinessObjectTranslationCollection Translations, ContainerControl SourceContainer, ContainerControl DestinationContainer)&lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.UserControl.TranslateBusinessObjects()&lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.UserControl.InitializeObject()&lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects()&lt;br&gt;
   bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)&lt;br&gt;
   bei System.Windows.Forms.Form.OnCreateControl()&lt;br&gt;
   bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;br&gt;
   bei System.Windows.Forms.Control.CreateControl()&lt;br&gt;
   bei System.Windows.Forms.Control.WmShowWindow(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Control.WndProc(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Form.WmShowWindow(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Form.WndProc(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(Message&amp; m)&lt;br&gt;
   bei System.Windows.Forms.Native&amp;#119;indow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;
[/codesnippet]</description><pubDate>Thu, 27 May 2010 10:05:09 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27244.aspx</link><description>Glad you got it going. :D</description><pubDate>Thu, 27 May 2010 10:05:09 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27243.aspx</link><description>Hi,&lt;br&gt;
I reproject logic :) It seems better to place class instance then subclass it.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Thu, 27 May 2010 08:59:31 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27222.aspx</link><description>At this point, a small sample app would really help. Then I could open it and not only see what's going on, but also offer suggestions (or cry for help :blink: from Trent et all). I'd suggest you make a sample app using BOs from the StrataFrameSample, that way I'll have the data/structures already and it will keep it simple.</description><pubDate>Mon, 24 May 2010 18:11:42 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27218.aspx</link><description>Hi,&lt;br&gt;
UserControl3 inherits UserControl1.&lt;br&gt;
&lt;br&gt;
On userControl1 I made BusinessObject [b] public [/b]. I expect it will visible for the new Form for BO translation also (new form where I going to place UserControl3), but..&lt;br&gt;
&lt;br&gt;
When I put UserControl3 on the form and try to make BO translation, in the Wizard form - I can see NO business object. Just for example, when I drop in design time some new business object to UserControl3 - its avaliable for translation in new form. But if BusinessObject comes from inherited UserControl1 - its not available.&lt;br&gt;
&lt;br&gt;
But as I told before.. error comes from case when&lt;br&gt;
&lt;br&gt;
UserControl3 Inherists UserControl1.. &lt;br&gt;
and UserControl1 has BusinessObject and translation with UserControl2 (userControl2 located in the userControl1 and has same BO).&lt;br&gt;
&lt;br&gt;
As I thinking.. the Public Modifier initialize BusinessObject in UserControl3 more late then its using in parent UserControl1 to initialize Translation. and If I use Private BusinessObject - I can't made new translation with new form where UserContrl3 placed.&lt;br&gt;
&lt;br&gt;
I hope I explain it good enough.. :)</description><pubDate>Mon, 24 May 2010 16:53:59 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: BO translation and subclassing</title><link>http://forum.strataframe.net/FindPost27217.aspx</link><description>If I'm following you, you likely need to make the field under the BO to be protected. That will make is available to sub-classes. You can change this in the designer, under the Design category in the property window, the Modifier property. If it's set to private, then this could be your problem. If it's already set to something else, then we'll have to dig deeper.</description><pubDate>Mon, 24 May 2010 15:03:38 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>