Alec Pojidaev's InfoPath Blog
Stuff published for no reason (cool codeless infopath solutions mostly)

How to check if your InfoPath form is “dirty”? (Tracking changes)

Bookmark that post

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)

About these ads

3 Responses to “How to check if your InfoPath form is “dirty”? (Tracking changes)”

  1. 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.

  2. 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.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 40 other followers

%d bloggers like this: