I am simplifying my form setup for readers/responders.
Form Setup
Drop Down A : Has list of Countries
Text Box B: Populates the cpaital of the selected country.
Data connection type: XML Data Connection. http://site/subsite/_vti_bin/owssvr.dll?Cmd=Display&List={11111111-2222-3333-4444-555555555555}&XMLDATA=TRUE
Upon selecting 'Country' I am using a XML Data Connection to retrieve the name of Capital city from the SharePoint List by modifying theFileLocation to -
http://site/subsite/_vti_bin/owssvr.dll?Cmd=Display&List={11111111-2222-3333-4444-555555555555}&XMLDATA=TRUE&FilterField1=Country&FilterValue1=USA
Below is the pseudo code executed when Country is changed.
drpCountry_Changed(Object sender, XmlEventArgs e)
{
FileQueryConnection qryConn=(FileQueryConnection)this.DataConnections[country];
qryConn.FileLocation= http://site/subsite/_vti_bin/owssvr.dll?Cmd=Display&List={11111111-2222-3333-4444-555555555555}&XMLDATA=TRUE&FilterField1=Country&FilterValue1=e.NewValue
qryConn.execute();
}
Basic Execution
The form works perfectly. It populates the capital city of the selected country.
Problem Statement
Steps -
a. Open the form, select Country=USA, it populates the Capital city as Washington DC
b. Now without closing the form, change the Capital city of USA to Philadelphia in the Share Point List.
c. Now select USA again in the Form. It populates the capital city as "Washington DC" as opposed to "Philadelphia"
d. Close the current form, ReOpen the form and select country=USA, it now populates the capital city as "Philadelphia"
I am not sure why would it cache the contents of list.
I would appreciate any guidance on this issue.
Troubleshooting steps
I compared the XML data obtained by the query in the infopath form and the XML data returned by browser when I paste http://site/subsite/_vti_bin/owssvr.dll?Cmd=Display&List={11111111-2222-3333-4444-555555555555}&XMLDATA=TRUE&FilterField1=Country&FilterValue1=USA in the browser.
The XML data returned to InfoPath contains Capital City as Washington DC, but the browser reflects the change.