Save Secondary Data from Web Service into Form - InfoPath Dev
in

InfoPath Dev

Save Secondary Data from Web Service into Form

Last post 04-25-2014 08:14 AM by Technette. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-20-2014 11:53 AM

    Save Secondary Data from Web Service into Form

     Hi!

     I have secondary data that comes in from a SOAP web service.  The secondary data comes into two repeating tables.  I need this data to be saved in the form so that the next person that opens the form will view it in read only format.

     What is the code for saving this data to the main data source?

  • 01-20-2014 10:44 PM In reply to

    Re: Save Secondary Data from Web Service into Form

    Hi Technette,

    Here is a link for submitting and saving data. To set the page as ready only, you may create a new view under the Page Design tab in (Infopath 2010), and set the page as read only.

    After setting up the read only page, have your submit/save button switch to this page first before submitting your data. This way, the read only page will be the current view whenever the saved form or xml is opened. Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 01-21-2014 09:13 AM In reply to

    Re: Save Secondary Data from Web Service into Form

     Thank you for responding.  My secondary data still won't save even when I enabled the save option.

  • 01-21-2014 09:25 AM In reply to

    Re: Save Secondary Data from Web Service into Form

    You are on the right track - if you want the secondary data to be saved, you have to copy it into your main data source. Here's an MSDN link that may help you with the code:
    http://msdn.microsoft.com/en-us/library/office/aa945227.aspx

    qRules can also help you with this.

    Hilary Stoupa

  • 04-23-2014 01:15 PM In reply to

    Re: Save Secondary Data from Web Service into Form

    Hi!

     

    I know it's been a while since I asked the question.  I have the following event load for copying data to a repeating table but I'm getting a null value at the bolded line.  Is my syntax correct?

    It found the webservice but I get a null reference error.

     

     

    public void LoadPartData_Clicked(object sender, ClickedEventArgs e)
            {
               
                XPathNavigator secPartDSNav = DataSources["GetPartsDetailFromPTNum"].CreateNavigator();

                //Retrieve the rows of the secondary data source

                XPathNodeIterator rows = secPartDSNav.Select(
                    "/dfs:myFields/dfs:dataFields/tns:GetPartsDetailFromPTNumResponse/tns:GetPartsDetailFromPTNumResult/q1:Parts", NamespaceManager);

                //Loop through the rows of the secondary data source and fill the repeating table

              
                while (rows.MoveNext())
                {
                    string ID = rows.Current.SelectSingleNode(
                        "@q1:ID", NamespaceManager).Value;

                    string DESCRIPTION = rows.Current.SelectSingleNode(
                        "@q1:DESCRIPTION", NamespaceManager).Value;
                    string DRAWING_ID = rows.Current.SelectSingleNode(
                        "@q1:DRAWING_ID", NamespaceManager).Value;
                    string DRAWING_REV_NO = rows.Current.SelectSingleNode(
                        "@q1:DRAWING_REV_NO", NamespaceManager).Value;
                 //Add the item to the repeating table
                AddItem(ID, DESCRIPTION, DRAWING_ID, DRAWING_REV_NO);
                }
               
                //Remove the first empty item from the repeating table
                DeleteFirstEmptyItem();
            }

  • 04-25-2014 08:14 AM In reply to

    Re: Save Secondary Data from Web Service into Form

     I found that the problem is that the query string that is coming in for the rows combines all the data in one string and there is no separator. 

    The value is coming in like "3455 DESCRIPTION, TIN1-55755NNo Sales Activity1-55755*LA*FNUNAS"  

    This represents all four fields of data.

     

    How do I parse this? 

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.