StrataFrame Forum

BO IsDirty Property

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

By Larry Caylor - 6/3/2006

It appears that when a row is placed in editing state using a standard SF maintenance window the row’s IsDirty property is set to true even if no fields are modified.  I’m using the primary BO on the form only to retrieve another BO that I wish to edit. I’m not making any changes to the primary BO.

 

To get around the issue of having the framework prompt me with a “do you wish to save…” message I’m using the primary BO’s BeforeSave event to do an Undo on the primary BO’s current row. This allows the “save message” to be automatically be displayed for the other object but not the primary.

 

It would seem that the row shouldn’t be set dirty if no fields were modified.  Is this by design or is it a bug?

 

-Larry

 

By StrataFrame Team - 6/4/2006

That functionality is by design, actually.  When you call edit on the business object, the current DataRow is automatically set to Modified.  The reason for this is that the business rules are never checked unless the record is in a modified state.  So, to force the business rules check when a record is edited, it first had to be set to modifed. 

I'll look into some other ways for you to get around that functionality.

By StrataFrame Team - 6/5/2006

I added a SetDirtyOnEdit Boolean property to BusinessLayer that defaults to False. It functions just like the method implies: If it's True, then the record is set to dirty when Edit() is called; if it's set to False, the record is not set to dirty when Edit() is called, but rather waits until some data has changed.



It will be available in the next release.
By Larry Caylor - 6/5/2006

Thanks! I like itSmile

-Larry