How to check if your InfoPath form is “dirty”? (Tracking changes)
1) Create field called InitialState
2) At open event assign InitialState field to the following Xpath expression:
.. Yes, it’s two dots :)
3) At the submit rule compare InitialState field with the following expression assuming it’s a rule condition at a button:
starts-with(., my:InitialState)
Make sure the InitialState field is a very last node in the myFields group fields list.
I also believe some people might have find interesting the way I used conditional expression to parameterize the output message.
Here is form to test
Form
with more advanced XPath (InitialState can be at any position)
I am glad to have found this article. I am having problem with the issue of allowing the user to update the web-compatible infopath form, can you give me some help? change the Postback settings for the control did not seem to work. Adding an Update Form button using Update Form Action did not work neither.
Thank you in advance.
dvn - November 5, 2009 at 10:14 pm |
Actually I don’t understand what is your problem well enough.
alecpojidaev - November 5, 2009 at 10:23 pm |
This is a really nifty technique, but I suggest putting the InitialState field in a secondary data source so you don’t have a whole bunch of extra muck in the main data source.
This should probably also allow you to use the expression . = InitialState, which will be more reliable.
Jimmy Rishe - December 26, 2011 at 5:42 am |