Adding Child BOs Exception


Author
Message
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
Good, I'm glad that fixed it... I would have mentioned something earlier, but for some reason, I was thinking you were the one that found the bug and already had the fix for it.  Oh well Smile
Derrick Bell
Derrick Bell
StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)
Group: Forum Members
Posts: 33, Visits: 71
That was it.. the error is gone now. On to new horizons.

Derrick

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
Keep me posted...
Derrick Bell
Derrick Bell
StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)
Group: Forum Members
Posts: 33, Visits: 71
That could be it. I'll Download the latest and let you know.

Derrick

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
You said that the Driver1 business object gets filtered correctly... there was a bug in the FilterChildRecords() method that caused it to fail if the parent business object attempted to filter more than one child business object because the filter was not correctly reset after each iteration through the child business objects... I thought that you were the one that found the bug, but maybe not.  It was resolved last week, so it this might just be a bug that was resolved and you just need the latest version.
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
At the point when the exception is thrown, the new record will have already been added to the business object... I was just wondering if the primary key for the record was a negative number or if it was NULL.
Derrick Bell
Derrick Bell
StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)
Group: Forum Members
Posts: 33, Visits: 71
Seems the error is occuring with the setting of the ParentBusinessObject in any new child objects I add.

The primaryKey of Parent table is: caseid this is the also the FK in my child objects

I check if parent records exist before populating the children:

Private Sub Cite1_Navigated(ByVal e As MicroFour.StrataFrame.Business.NavigatedEventArgs) Handles Cite1.Navigated

     '-- Make sure there are records in the citation BO, otherwise
     ' an error will occur.

     If Cite1.Count > 0 Then
     '-- Load the childBOs
          Me.Driver1.FillByParentPrimaryKey(Cite1.case_sid)
          Me.Officer1.FillByParentPrimaryKey(Cite1.case_sid)
          Me.Violations1.FillByParentPrimaryKey(Cite1.case_sid)
     '-- Requery the officer list
          Me.lstOfficers.Requery()
     End If

End Sub

Note my first child object Driver1 is working properly. Working with Trent we set the following settings on the Parent object Cite1 and the Driver child object.

IncludeFormAdd: True
IncludeFormEdit: True
IncludeFormDelete: True
IncludeFormSave: True

Would these setting affect workings of the two new child objects I'm trying to add?

adfadfasd

Derrick Bell
Derrick Bell
StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)
Group: Forum Members
Posts: 33, Visits: 71
There is no key yet because I'm adding a new reocrd.

Derrick

Derrick Bell
Derrick Bell
StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)StrataFrame Beginner (41 reputation)
Group: Forum Members
Posts: 33, Visits: 71
I might have been trying to do too much at once. When I initially added the ChildBO, I configured the parent-child properties immediately. Is this okay? Or should I build solution first?

Second there might be issues with the underlying database changing keys, so I deleted the object and it's mapping. Dropped and rebuilt the database table and am in the process of reviewing.

Derrick


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
Yep, happened while you were trying to set the filter on the child records... what are the primary and foreign key fields, and what is the value of the primary key in the parent record when the exception is thrown?
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