Hi Guys
This is my first post in the infopath dev forums. I would like to say thanks for having such a great forum and apologies if I am posting in the wrong place..
I need some assistance in refreshing a secondary data source in my infopath form library form after data has been submitted.
Basically what happens is that after a user selects options from some drop-downs and clicks submit(custom rules button), a SharePoint workflow runs to update the necessary fields in a separate list connected to the form library by a unique identifier. The same list that gets updated is also a secondary data source in my form.
In my Infopath form I have a field which is bound to a column in that secondary data source(or list), which is a status field. After the user clicks submit, the workflow updates bound field and I would like the form data to refresh to show what the current(bound status) field shows from the secondary data source.
I have discovered the Refresh button, but the problem with that is some users might not click the refresh button as well as custom code cant be put on the refresh button but only on a custom code button.
Also, because of workflows running i'm afraid the data maybe refreshing too quickly before the workflow has finished running. Are there any other ways of automatically refreshing data in InfoPath 2013? Maybe when a field has changed, or another input from a drop-down has been chosen using code?
I have added rules to query the secondary data source when a field changes but form some reason it does not update the data sources.
We usually don't add code to forms but in this instance, if it is an option I wont mind putting it in.
I have tried adding the code below to the button, but as mentioned maybe its refreshing too quick?
DataSources["DataSourceName"].QueryConnection.Execute();
Thanks in advance!!!