Avatar

Level 10

Hi, It probably depends on how complicated your form is but you can save the form data using "$record.saveXML()", this will return a string containing the form data as XML, this could be saved in a form variable (or series of form variables if you want multiple undos).  Then when you want to undo you can do a $record.loadXML({the string you saved}).  But after that you will have to do a xfa.form.remerge() and that can be a bit of a killer as any script run in initialising, docReady, layoutReady, etc will need to be reexecuted.

So depends on how complicated you form is.  Also wont help undoing adding attachments or pictures if you have any of those.

Good luck,

Bruce