StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
Second BO not included in Form Save
Second BO not included in Form Save
Post Reply
Like
1
Second BO not included in Form Save
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Andrew Harper
Andrew Harper
posted 10 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 87,
Visits: 3.3K
Hi,
I have a maintenance form that maintains a primary bo named boPromo. When in Edit mode the user can click a button to load details into a second bo boPromoDetails.
The form "IncludeInFormEditType","IncludeInFormSaveType" and "IncludeInFormUndoType" properties are set to "DeterminedByBusinessObject" .
The form "IncludeInFormAddType","IncludeInFormDeleteType" and "IncludeInFormNavigateType" properties are set to "PrimaryBusinessObject"
boPromo has all the "IncludeInForm..." properties set to True.
boPromoDetails has "IncludeInFormSave" and "IncludeInFormUndo" set to True.
boPromoDetails is not being included in the form Save. If I set a breakpoint in the form BeforeSave then boPromodetails.isDirty = true.
A breakpoint in the boPromoDetails.BeforeSave handler is not fired.
If I code a boPromoDetails.Save() in the form.BeforeSave then boPromoDetails.BeforeSave handler is fired and the details are saved correctly.
What am I missing here?
TIA,
Andy
Reply
Like
1
Reply
Andrew Harper
Andrew Harper
posted 10 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 87,
Visits: 3.3K
I located my problem:
1. In the boPromotion.Navigated event I was filling boPromotionDetails with records relating to boPromotion.
2. boPromotion.Navigated is being fired by the form save before boPromotionDetails was being saved, as a result boPromotionDetails.IsDirty became false and no save was performed. I can get around this by checking the form EditingState in boPromotion.Navigated before repopulating boPromotionDetails.
This raises the question as to when to populate related BOs. In the Enquiry only forms that I have developed so far I have always repopulated any child BOs in the parent bo.Navigated event.
In order to use the ChildAutoFilter = MatchCurrentRow on the child BO, from my testing the child BO must first be populated with all the records relating to records in the parent BO.
Am I missing something here? I am interested to hear what others are doing,
TIA
Andy
Edited
10 Years Ago by
Andrew Harper
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Second BO not included in Form Save
Andrew Harper
-
10 Years Ago
Do you have a relationship setup between the two business objects?...
Trent L. Taylor
-
10 Years Ago
Thanks Trent, I will try establish the relationship and test. More...
Andrew Harper
-
10 Years Ago
No, but if they are related you will want to tie them together. This...
Trent L. Taylor
-
10 Years Ago
I located my problem: 1. In the boPromotion.Navigated event I was...
Andrew Harper
-
10 Years Ago
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search