StrataFrame Forum

Save Changes on Exit Problem

http://forum.strataframe.net/Topic17959.aspx

By Douglas Riley - 7/21/2008

I am having a problem with the Save Changes dialog.  The dialog box appears when attempting to close a form when I have not modified or added any records.  If I just open the form and close it, the dialog does not appear.  If I navigate to another record and attempt to close the form, the "Do You want to save changes?" dialog appears Crazy! This form has a one-to-many business object relationship (4 child business objects).  Another odd thing is if I don't preload the child bo's when the form initializes, navigate to another parent bo record and attempt to close the form, the dialog does not appear.  Am I missing a setting somewhere?  Any help would be appreciated!  Thanks!

Doug

By Trent L. Taylor - 7/21/2008

Well, the good news is that the only way that dialog will appear (if you are allowing it to show) is if one of the BOs on the form is dirty.  So you will want to look at your code and see which BO is becoming dirty.

When the form is closing, it will enumerate through the Businessobjects and collection and check if any of the Bos are dirty...if so, the form will come up.

So you will want to handle the IsDirtyChanged event of the BOs, set a break point on the set of a BO property, or something that will help you diagnose the problem.  So the first thing to figure out is which BO and field property is becoming dirty then you can work from there.

By Greg McGuffey - 7/21/2008

I've had this happen several times. Thus far it has always been something I've done Sad



The trick it to handle the IsDirtyChanged (something like that) event of the BO(s)...just put a break point there. Open the form, navigate, close it...at some point this event will fire. Look at the call stack as see were you're inadvertently causing the BO to be dirty.



Hope that helps!
By Edhy Rijo - 7/21/2008

Hi Douglas,

Also, check if you have any custom field property or a function/method that may be updating one of your BO's field and then becoming dirty as Trent and Greg suggested.

By Douglas Riley - 7/21/2008

Thank you all for the replies!  I will give this a shot and see what happens.  Thank you all!
By Douglas Riley - 7/21/2008

Got it!  Added the IsDirtyChanged event to each BO and the guilty party appeared immediately.  Again, thank you all!
By Greg McGuffey - 7/21/2008

Cool! BigGrin
By Edhy Rijo - 7/21/2008

Douglas Riley (07/21/2008)
Got it!  Added the IsDirtyChanged event to each BO and the guilty party appeared immediately.

And what was causig the problem....?

By Trent L. Taylor - 7/22/2008

Glad you got it going Smile