Business Object 'IsDirty' property


Author
Message
Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Is there a way to prevent the 'IsDirty' property from being set when you modify a business object?  The SetDirtyOnEdit = False works okay until you actually change the business object.  I have a couple business objects on a form which require some pre-processing and I don't want these to trigger my Save message.

Tim

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
The IsDirty property actually looks through the DataTable to see if there are any changes.  To "reset" the IsDirty property all you need to do is reject the changes on the DataTable (or AcceptChanges if you want to keep the data the same within the DataTable but just not write it back to the server).  This will reset the IsDirty flag and you can then have the behavior you are looking for.

FYI....in version 1.6.1 there is now an IsDirtyChanged event that you can handle which will tell you immediately when a value within the internal DataTable has been changed.  This really doesn't matter much to what you were doing, but I know that people have asked for this in the past and I could not remember if you were one of them. Smile

Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Exactly what I needed.Smile  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