How to Get Web Enabled Form Data upon the user submission - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to Get Web Enabled Form Data upon the user submission

Last post 09-03-2007 11:00 PM by nukkumatti. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-02-2007 08:26 PM

    How to Get Web Enabled Form Data upon the user submission

     Hi,

      I am new to Info Path 2007, I have created a web enabled form using Infopath, and published into a sharepoint site, whenever user enters the data and clicked on save button, the form is saving in FormLibrary in my sharepoint site. My question, whenever the user clicked on save button, i need to grab some information from the infopath form. How can i do this programatically using C# ?

     

    Or, when the form is saved in sharepoint site, that form is in .xml format, and the form data will be stored in content type (If i am wrong please do let me know),if i want to get the Form Data from the Content Type how can i ?

     

    Thanks

    Sree
     

     

    Filed under: ,
  • 09-02-2007 11:29 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: How to Get Web Enabled Form Data upon the user submission

    Hi Sreenivas Welcome to the Forums,

    You can write the code in onClick event of Save button to get the information from your form.

    On which field data you want? If you want to get the one field data you can use below the code:

    IXMLDOMNode node = thisXDocument.DOM.selectSingleNode(“XPath of your node”);

    string nodeValue = node.text;

    Hope this helps you

  • 09-03-2007 02:33 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    Just a small correction Shiva. Sreenivas mentioned that he/she is using 2007 so thisXDocument won't work. You have to use XPathNavigator instead. Please refer to the Object Model of 2007.

    Listen to Motörhead cos they play Rock'n Roll :)
  • 09-03-2007 05:56 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

     Hi,

    You are right.. I need to use xpathnavigator instead of thisXDocument.. My requirement is i am using WebEnabled forms, with in that i have 100 fields, whenever the user filling this form, he has to enter the data. After filling this form, whenever he clicks on save button, i need to do some validation and also need to grab the data from that form.. dont forget this is webenabled form, i think for this type of forms, i dont see any save button event handler.. so in this do i need to write any custom save button, or how can i use the existing save button event handler.. do let me know, this is very urgent...

     

    Thanks

    sreeni 

     

  • 09-03-2007 06:33 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    Your are on the right track. You cannot use the Save button from the menu bar. You have to create a custom submit/save button which uploads your form to the SharePoint library. This is quite easy to do. Go to Tools, DataConnections and set up a new data connection to submit data to a SharePoint library. enter the path to your library. now add a new button to your form, double click it and select edit from code. now you can write your custom code. search the forum for Application.errors.count (or something similar) to see how you can do your validation quite easily if you have to validate a large number of fields and search for DataAdapters or DataObjects to see how you can call your dataconnection to trigger from code. how you can grab the information from your controls you know already. hope this helps..

    Listen to Motörhead cos they play Rock'n Roll :)
  • 09-03-2007 07:23 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    Hi nukkumatti,

     

    I did exactly what you said.. i have created dataconnection from tools->dataconnection->newdataconnection.. after that i entered the specified formlibrary path... After that i created a button and named as a submit... so what shall i do now..for the form saving.. what is the code for custom button(submit). Please help me

     

  • 09-03-2007 07:43 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    not to sure about the syntax as i haven't used 2007 a lot. in your onlick event of the button you have to write something like (2003 jscript code) var dataAdapter = XDocument.DataAdapters("NameOfYourDataconnection"); dataAdapter.Submit(); (this will for sure be different in 2007 with managed code, are you using c# ?). Of course before calling this you should get the data from your controls and do with it what ever you need to do. what is actually the reason to grab the info from your controls in the button event ? instead of using code you can also double click the button, click rules and then select Submit using a data connection as the action.

    Listen to Motörhead cos they play Rock'n Roll :)
  • 09-03-2007 08:40 AM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    Hi nukkumatti,

    Thanks for the immediate reply.. I think JScript will not work in Infopath 2007 web enabled forms. So do you have any idea about this... ?

     

    Thanks 

     

  • 09-03-2007 11:00 PM In reply to

    Re: How to Get Web Enabled Form Data upon the user submission

    Hi, I really recommend that you refer to the object model of infopath 2007. i don't have it installed here so i cannot provide you any more detailed information. search this forum for any other info or just try to google it. sorry, may be someone else can jump in.

    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.