StrataFrame Forum

How to find which field is dirty?

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

By lastcanary - 5/30/2012

I have a number of Business Objects on my form. In edit mode, even though I didnt do any change to any field and I try to close the form I get the save confirmation message. I found out that some Business Objects have IsDirty porperty true but I couldnt find out how to detect which fields are dirty.

Could you please help?
By Edhy Rijo - 5/31/2012

Hi,
A BO becomes dirty when you:
  1. Call BO.Edit() or BO.Add
  2. When you assign a value to one of its properties
Most common cases is when you have code in a combobox.SelectedIndexChanged which will be triggered when the form is loading and then if you modify a BO property, the BO.IsDirty will be True.

When the form is closing there is code that will loop through all BOs and check for bo.IsDirty = True and then show you the message.  The solution is review any code where you may be assigning a value to any of the BOs properties and that will fix this issue.
By Ivan George Borges - 5/31/2012

Add an IsDirtyChanged event to your BOs. Set a break-point to them and run your application. At the time the IsDirty gets changed, your application will enter into debug and then you can check the Call Stack, which will give you the path it went on to "dirty" your BO.