Editing secondary BO on form Enables Save/undo on maintenance toolstrip


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a form that has two BOs on it. One is a parent, the other is a child, however I've turned this off (the child BO's parent BO property is cleared and I've also set the filter child records property to off on the parent).



I have a maintenance toolstrip for the primary BO and a set of buttons to manage the editing of the secondary bo. The maintenace toolstrip works as expected when I use it. However, whenever I edit the secondary bo via the Edit method, the Save and undo buttons become enabled on the maintenance tool strip, the edit,new and remove are still enabled and the primary 2data isn't editable. When I undo or save the secondary bo, again the save/undo buttons on the maintenance toolstrip are disabled.



Any Ideas as to whats wrong here?
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
One more bit of info. If I click on the Save button on the maintenance toolstrip that was enabled when the secondary bo is editing, it disables the save/undo on the maintenance toolstrip, but doesn't affect the secondary bo (apparently, the data is still editable).
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, I made a little test project to see if this is reproducible and it is. I also realized that I didn't quite see what was happening:



When the secondary BO is edited, the maintenance toolstrip enables just the Save (undo still disabled). The New, edit and delete remain enabled.



If the Save on the maintenance toolstrip is clicked, it DOES change the state of the secondary BO, it is saved!



I also notices a SaveByForm method on the BO, which is getting me to think that the Save button on the maintenance toolstrip is saving all BOs on the form.



I've included the test app. Connect it to the StrataFrameSample database (uses the Customers and CustomerNotes tables). Steps to repo:



1. Navigate to customer with notes

2. Click on Edit button under notes

3. Note Save in maintenance toolstip is enabled, new,create and delete are enabled, undo is disabled, customer data is disabled, note data is enabled

4. Click on save button under notes, note that save is disabled, notes data is disabled

5. Click on Edit button under notes

6. form in state as noted in step 3.

7. Click on Save in maintenance toolstip

8. Note that save is disabled, notes data is disabled.

Attachments
TwoBOMaintenaceToolstripIssue.zip (77 views, 782.00 KB)
StrataFrame Team
S
StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)StrataFrame Developer (4.4K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
The strange functionality is tied to the IncludeInForm settings.  By default, all business objects are included in a from Save(), but only the primary business object is included in anything else (Edit(), Add(), Undo(), etc.).  So, when you call Edit() on the secondary BO, the form is watching it because it is included in a form Save(), and when it becomes dirty (because you called Edit() on it), the Save button becomes enabled.  But, since only the primary business object is included in the undo, the undo button does not become enabled.  To have the MaintenanceFormToolstrip completely handle the parent BO and completely ignore the child BO, you will need to set the form's IncludeInFormSave property to PrimaryBusinessObject.  Then, the MFTS will handle the primary BO and your buttons will handle the child BO.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ah...thanks. I've seen that IncludeInForm property mentioned before, but it obviously didn't sink in.
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