Syncing a supporting BO with the primary BO


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a BO on my form which uses a few other BOs to get property and the like.  I would like to have properties on my primary BO which point to properties on the secondary BO.  For example if I have a secondary BO called Clients which is linked by the ClientKey on the primary/seconday BO, and want to get the Client Description I would have a property like this:

Public ReadOnly Property ClientDescription as String
  Get
    Return Clients.Description
  End Get
End Property

The question I have is how I keep Clients looking at the right record when I am navigating around in the primary BO.  I fill the Clients BO with all clients in the Fill of the primary BO and I have some code in the Navigated and CurrentDataTableRefilled event handlers to navigate Clients to the correct primary key when the primary BO record changes.  

My problem is that when I get into the Navigated event my Clients.Count is 0.  When it starts the Fill method the Client count is a few hundred, but it clears it out somewhere along the way.  Any idea what I am doing wrong here, or if there is a better way of doing what I'm trying to accomplish?  I can't really use the parent/child relationship here because it doesn't make sense in other areas of the database/code.

Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
The CurrentDataTable.Rows.Count corresponds to Clients.Count....both are correct when in the PrimaryBO_CurrentDataTableRefilled handler, but when it gets to the PrimaryBO_Navigating event handler, the counts are zero and there is not a Filter set, it is "". 

I looked at the BusinessLayer code here and there wasn't much going on between these events that I could see.  I also don't handle any events for Clients and it is a private object so it's not messed with anywhere else either.  I will continue looking, but I can't see anywhere I am filtering the rows or refilling the table. 

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Hrm... you could try putting a handler on the CurrentDataTableRefilled event of the child business object and put a break point in it.  Then look at the CallStack window and see what called the refill further up the line.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search