Checking if an entity is 'dirty'..

Checking if an entity is 'dirty'..

  

Is there any support for checking if an entity attribute has changed during editing? I want to log something if a certain field gets edited. I'm guessing I could just modify the Save action to query the database for the original values and then compare but I was wondering if there was some native way to do this?
Hi Dave,

Yes, in a screen action you can just compare the original record in the preparation (probably the current in a query) with the record in the editrecord widget:



Cheers,
Tiago Simões


Hi Tiago,

You're formula checks whether any user changes have been made to the record.  Would you simply extend the formula to include an attribute on both sides of the equation to determine whether the attribute has changed and would that same formula work an attribute's value were changed from or to null?

And what if an attribute value was changed not by the user, but was assigned during the save action and you wanted to determine in a subsequent part of the save action whether the value had been changed.  Is there a method to retrieve the original or old value or would you simply store it in a local variable?

Thanks!

Bill

Hi William,

I bet you have already sorted it out, but answering your two questions:
1) Yes, that would be it.
2) You would need to store it in a local variable.

Cheers,
Tiago Simões