Is it possible to script to detect if any change occurred since the form was opened? For example if one of the text objects now has different text or no text or if a check box is now unchecked or a dropdown slection has changed?
What I plan to use this for is updating the connected database. When the form is closed, if there have been any changes to the form, the form data is exported to the database; updating the database to match the form. If no changes have occurred since the form was opened, no export to the database occurs.
As far as your question if the user makes a change and then outs it back to the original value, reste the textField would be great but not absolutely necessary. The database data would still match the form.
Using the PreSave event seems to make sense so i will do some testing to see if I can get it to work.
I will mark your answer correct as soon as i can get this test done. Thank you for your help with this project.
I think you will need to do this in the preSave event. The dirty flag is a per session thing, I guess it is what drives the "Do you want to save changes to ... before closing" message if you attempt to close a form without saving the changes.
So the dirty flag is always false at docOpen.
Will you need to reset the textField if the user changes the form values back to the original values (or blanks them out)?
Sorry - I don't know what you mean. I want to beable to detect a change to any object on the form after the form is opened. So for example, have a text field object with a script that states if a change is made to any of the objects on the form, this text field's rawValue will equal "Changed".
So would I put your script in the Form docReady event? Something like this?