If you have created InfoPath forms for simple CRUD operations with SQL Server, have you ever wondered how to refresh the secondary data source which refresh on Submit? InfoPath form provides an action called “Refresh”, but for that you need to use an extra button in the form. The user has to click the Refresh button every time whenever they submit the form, which is not that intuitive, right?!
So, what is the alternative? How do you refresh the secondary data source, which loads the latest values which you just inserted using “Submit”? Here is a simple trick for that.
Instead of using the Database directly, go with the Rules. Here is the screenshot of submit button properties and submit options.
Now, your 1st rule is to submit the data using the main data source.
The second rule should be “Query using a data connection” action, and select the secondary data source for that action.
That’s it! you are done refreshing the secondary data source.
I just gave the numbering for the order of setting windows. yes, you need to go that deep to find that refresh guy!