On a SF Maint Form, does clicking the Undo button call the Maint form’s undo method or the primary business object’s undo method? I have a Maint form with two business objects that have a parent-child relationship. Undo is working on the parent but not the child and I believe it’s because the Undo button only calls the parent’s (primary object) undo method. If so I know how to get the behavior I want, I just want to make sure I understand what is going on.
-Larry
Take a look at the "IncludeInFormUndoType" property on the form. This can be combined with a counterpart property on the BO called "IncludeInFormUndo". Basically, you can have the "Undo" action applied to the PrimaryBO, AllBOs or determined by BOs that have their IncludeInFormUndo property set true.
This logic can be applied to all other "actions" like Save, Edit, Delete, New, Navigate etc.,
HTH
-=Gary
The "states" enhancement sure is resolving quite a few issues
What a great idea !
Gary,
Thanks for the info. I was aware of the BO property “IncludeInFormUndo” but missed its counterpart ‘IncludeInFormUndoType” at the form level. I gave this combination a try but it didn’t produce the exact result I was looking for. My child object is being displayed in a ListView on the maint form and is being refreshed in the ‘EditingStateChanged” event handler for the form. When I click Undo on the form the old values are not being reflected in the ListView and I’m assuming that is due to the order in which events are raised. “EditingStateChanged” is probably being raised before “Undo” on the child object. I can get the desired result by calling Undo on the child object in the “BeforeUndo” event handler on the form or refreshing the ListView in the “EditingStateChaged” event handler of child object.
StrataFrame provides a lot of options and therefore presents a definite learning curve, but I’m finding the more I work with it the more I like it.
Hi Larry,
>Thanks for the info.
No problem.
>I was aware of the BO property “IncludeInFormUndo” but missed its counterpart ‘IncludeInFormUndoType” at the form level. I gave this combination a try but it didn’t produce the exact result I was looking for.
Well, it should allow the Undo to occur on the child BO. As to the list not reflecting the changes, it needs refreshing, as you have established.
>or refreshing the ListView in the “EditingStateChaged” event handler of child object.
I would have thought that the logical place to refresh the List is in the AfterUndo event handler (for either the BO in question or the form). Refreshing in the "EditingStateChanged" event will mean some kind of conditional testing to ensure that you only refresh the list when you can detect an Undo action has occured. If you use AfterUndo, particularly using a BO specific handler, you can safely Refresh the list and know that you are doing it at exactly the right time/place/right BO.
>StrataFrame provides a lot of options and therefore presents a definite learning curve,
There is a learning curve with most tools but its fun learning
>but I’m finding the more I work with it the more I like it.
That's all that matters. I find SF intuitive and very productive.
Best