locked
Order of Web Service Calls for External Data Sources set to Retrieve Data when form is Opened RRS feed

  • Question

  • I have several drop-downs that use separate web service calls to retrieve data when the form is opened.  I want my web service to pull one dataset on the first call, store it as a static member of web service class, then use LINQ to select out the appropriate data for each of the subsequent calls.  So, I need to know if the order in which InfoPath executes its external data sources is deterministic.  Is there a way to be sure of the order without coding each call in the OnLoad method?
    Wednesday, February 23, 2011 9:37 PM

Answers

  • Hi,

    I think the best way is to get all the data from the webservice and to query this secondary data source after.

    1. Create a secondary data source of type "Receive data" pluggued on Web Service. Don't forget to check "Extract data when the form open" on the last screen of your data connection creation (or something like this...)

    2. Create all your secondary data source for all the combos. The data source must be of type "Receive data" and must be pluggued on "Document XML". You document XML must be a ressource file that looks like this "<DATAS><DATA></DATA><DATA></DATA></DATAS>".

    3. On the form "form_loading" event, you will have to fill programmatically your data source created in 2. with the data filtered of the data source created in 1.

    Hope this helps. 


    Visit my blog : http://rmatayron.blogspot.com/
    • Marked as answer by Leoyi Sun Thursday, March 3, 2011 2:05 AM
    Thursday, February 24, 2011 1:40 PM