Save Changes on Exit Problem


Author
Message
Douglas Riley
Douglas Riley
StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)
Group: StrataFrame Users
Posts: 21, Visits: 267
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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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!
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

Douglas Riley
Douglas Riley
StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)
Group: StrataFrame Users
Posts: 21, Visits: 267
Thank you all for the replies!  I will give this a shot and see what happens.  Thank you all!
Douglas Riley
Douglas Riley
StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)StrataFrame Beginner (49 reputation)
Group: StrataFrame Users
Posts: 21, Visits: 267
Got it!  Added the IsDirtyChanged event to each BO and the guilty party appeared immediately.  Again, thank you all!
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Cool! BigGrin
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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....?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Glad you got it going Smile
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