IsDirty Question?


Author
Message
fansanitis
fansanitis
StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)StrataFrame Novice (53 reputation)
Group: Forum Members
Posts: 45, Visits: 103
Whenever I do a BO.Add() to my business object the IsDirty flag is being turned on even though no bound UI controls have been changed.  I'm not sure but I believe its because I have several fields in the BO that have Custom Field Properties set.  The underlying table does NOT allow nulls on any field but the user is not required to enter all fields.  So for the fields that are not required I set the Null Value Option and Null Replacement value as follows:

Strings: Return Alternate On Null/Set Null On Alternate(reference type) -- String.Empty

Integers: Return Alternate On Null/Set Null On Alternate(value type) -- 0

DateTime: Return Alternate On Null/Set Null On Alternate(reference type) -- #1/1/1800#

The getting/setting of the values works fine but is that what is causing the BO to be flagged as dirty when a new record is added?  If so, how do I get around this problem?  I have a simple data entry app that clears the BO on each successful BO.Save and then adds a new record using BO.Add.  When the user closes the app, they're always prompted with the "Save Changes" message dialog since the BO is flagged as dirty.

Thanks!!

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