Need the ID back for a successful submitted Web Service InfoPath Form???? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Need the ID back for a successful submitted Web Service InfoPath Form????

Last post 01-03-2008 08:59 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-07-2007 09:18 AM

    • moojjoo
    • Not Ranked
      Male
    • Joined on 07-11-2007
    • NC
    • Posts 2

    Need the ID back for a successful submitted Web Service InfoPath Form????

    Instead of using xml navigation I am utilizing a class that was created after running xsd.exe.  Great tool and makes coding a lot quicker due to intellsense.

    However, submitting the data into the DB is not a problem, but for the world of me although I have the following: 

    public int SubmitForm(myFields newForm, class blah)

    {CODE to INSERT RECORD and GET sumID from stored procedure via the @@IDENTITY }return sumID 

    I don’t know how to populate a field after the submit in the XML file (InfoPath) so the next time if the field has a value I know to perform an update on the record based on the sumID.

    Once I get that trick firgured out I would love to know how to automate a delete if a user deletes the file from the SharePoint library.  I have the DB well built so if I run T-SQL on the sumID the record will cascade and delete all other child records.

    I am close to finishing this solution and was wondering if anybody had done this.

     

    <moojjoo/>
  • 01-03-2008 08:59 AM In reply to

    Re: Need the ID back for a successful submitted Web Service InfoPath Form????

    Hi moojjoo and sorry for the late reply!

    Yes, you can get the returned ID.  I assume you are using a "Submit" data connection in InfoPath, which makes it impossible to see the return statement unless you are using code to submit the data connection.  If you want to add code, look at the .OutputLocation property on the WebServiceAdapter2 class.

    Otherwise, you can convert your data connection to a "Receive" data connection (the first question in the data connection wizard), populate the queryFields with the appropriate information, and then the return ID will be underneath the dataFields node once the query has been issued.

    The two data connections work exactly the same under the covers of InfoPath, but they are just handled a little differently by the designer and allow you to do different things with them.

    Good luck!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.