Submit to Sharepoint List - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Submit to Sharepoint List

Last post 05-17-2010 04:31 AM by ErnestoM. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 02-19-2010 05:07 PM

    Submit to Sharepoint List

    Hi. I have a browser enabled Infopath form containing a repeating table with 6 fields. 4 fields are set to receive data form a sharepoint list and the 2 remaining fields are to be completed by the user and resubmitted back to the same list. Essentially the user is verifying and statusing a task. One of the fields to be updated is multi line plain text and the other is a drop down list box used to select the status.

    Before I go rushing off to purchase qRules can you please advise if this is able to be created. Thanks


  • 02-19-2010 09:44 PM In reply to

    Re: Submit to Sharepoint List

    Hi Graham,

    Welcome to the forum! qRules, indeed, will allow you to submit and/or modify items from your SharePoint list, whether it be through your browser-enabled form or through InfoPath itself. It will work great on your dropdown list box and multi-line plain texts!

    Let us know if you need help setting up your qRules-based form.


    Mel Clemente
    Qdabra® Software/
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 02-19-2010 11:00 PM In reply to

    Re: Submit to Sharepoint List

    It can be done using Manged code, i've done this without using code.Let me know if you haven't purchased Q-Rules yet.

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 02-19-2010 11:33 PM In reply to

    Re: Submit to Sharepoint List

    Hi and many thanks for the reply. I haven't purchased qRules yet and any help would be appreciated. Thanks

  • 02-20-2010 12:38 AM In reply to

    Re: Submit to Sharepoint List

    Dear Graham,

     Keep a button in your form and then on button click event write this code for getting the values from the fields and passing them to Sharepoint list.

    public void btn_AdminSend_Clicked(object sender, ClickedEventArgs e)
                XPathNavigator Root = MainDataSource.CreateNavigator();
                string TravelRequestnumber = Root.SelectSingleNode("/my:travelRequest/my:TravelRequestNumber", NamespaceManager).Value;
                string EmployeeName = Root.SelectSingleNode("/my:travelRequest/my:Name", NamespaceManager).Value;
                string Approver = Root.SelectSingleNode("/my:travelRequest/my:ddbApprover", NamespaceManager).Value; ;
                string EmailID = Root.SelectSingleNode("/my:travelRequest/my:EmailID", NamespaceManager).Value; ;
                string Designation = Root.SelectSingleNode("/my:travelRequest/my:Designation", NamespaceManager).Value; ;
                string ClassTravel = Root.SelectSingleNode("/my:travelRequest/my:TravelerInformation/my:TravelClass", NamespaceManager).Value; ;
                string ModeTravel = Root.SelectSingleNode("/my:travelRequest/my:TravelMode", NamespaceManager).Value; ;

                XPathNodeIterator iter = Root.Select("/my:travelRequest/my:trips/my:trip", NamespaceManager);
                XPathNavigator DealInfo = null;
                XPathNavigator TripInfo = null;
                using (SPWeb Rootweb = SPContext.Current.Web)
                    Rootweb.AllowUnsafeUpdates = true;
                    SPList SourceList = Rootweb.Lists["Deal Cost Information"];
                    SPListItem newItem = null;
                    while (iter.MoveNext())
                        TripInfo = iter.Current.CreateNavigator();
                        XPathNodeIterator iter1 = iter.Current.Select("my:DealDetails/my:DealCostInfo", NamespaceManager);
                        while (iter1.MoveNext())
                            newItem = SourceList.Items.Add();
                            DealInfo = iter1.Current.CreateNavigator();
                            newItem["Travel Request Number"] = TravelRequestnumber;
                            newItem["Employee Name"] = EmployeeName;
                            newItem["Approver Name"] = Approver;
                            newItem["Email ID"] = EmailID;
                            newItem["Designation"] = Designation;
                            newItem["Class Of Travel"] = ClassTravel;
                            newItem["Travel Mode"] = ModeTravel;
                            newItem["Trip ID"] = TripInfo.SelectSingleNode("my:TripID", NamespaceManager).Value;
                            newItem["Travel From"] = TripInfo.SelectSingleNode("my:TravelFrom", NamespaceManager).Value;
                            newItem["Travel To"] = TripInfo.SelectSingleNode("my:TravelTo", NamespaceManager).Value;
                            newItem["Departure Date"] = TripInfo.SelectSingleNode("my:departureDate", NamespaceManager).Value;
                            newItem["Departure Time"] = TripInfo.SelectSingleNode("my:DepartureTime", NamespaceManager).Value;
                            //string Departure = TripInfo.SelectSingleNode("my:DepartureTime", NamespaceManager).Value;
                            //newItem["Return Date"] = TripInfo.SelectSingleNode("my:returnDate", NamespaceManager).Value;
                            //newItem["Return Time"] = TripInfo.SelectSingleNode("my:ReturnTime", NamespaceManager).Value;
                            newItem["Legal Entity"] = DealInfo.SelectSingleNode("my:ddbEntity", NamespaceManager).Value;
                            //string LegaLEntity = DealInfo.SelectSingleNode("my:ddbEntity", NamespaceManager).Value;
                            newItem["Category"] = DealInfo.SelectSingleNode("my:ddbCategory", NamespaceManager).Value;
                            //string Category = DealInfo.SelectSingleNode("my:ddbCategory", NamespaceManager).Value;
                            newItem["Sub-Category"] = DealInfo.SelectSingleNode("my:CategoriesSub", NamespaceManager).Value;
                            //string SubCategory = DealInfo.SelectSingleNode("my:CategoriesSub", NamespaceManager).Value;
                            newItem["Deals/BD"] = DealInfo.SelectSingleNode("my:BDDeals", NamespaceManager).Value;
                            //string Deals = DealInfo.SelectSingleNode("my:BDDeals", NamespaceManager).Value;
                            newItem["Cost Allocation"] = DealInfo.SelectSingleNode("my:CostAllocation", NamespaceManager).Value;
                            //string CostAllocation = DealInfo.SelectSingleNode("my:CostAllocation", NamespaceManager).Value;
                            newItem["Cost Per Deal"] = DealInfo.SelectSingleNode("my:CostperDeal", NamespaceManager).Value;

    Here when an Admin is clicking the button i'm moving the information from "my Trips" repeating table to the List "Travel Info for Deals". if you dont want to get the duplicates keep a check there,In my case, Admin Clicking is the last step after which there are no scopes of further change and Form would b sealed and final,that is why there are no chances of getting the duplicates items.Hope it may help you.

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 02-23-2010 04:06 PM In reply to

    Re: Submit to Sharepoint List

    Hi Mel,

    I'm looking at both options either to use qRules or managed code. Submit to Sharepoint list using qRules is probably easier for me however I'm having trouble publishing the form to a Sharepoint Library. After injecting qRules into my form and setting up the list connection the Infopath Publishing Wizard tells me the form template contains features not compatable with browsers.

    The form is published and works perfectly well prior to applying the qdabra rules and mapping connections. Infopath design checker indicates there are no errors in the form. Any ideas. Thanks


  • 02-26-2010 01:21 PM In reply to

    Re: Submit to Sharepoint List

    Hi, Graham - thanks for your interest in using qRules. Since qRules injects code into your forms, you will have to publish your XSN as an admin-approved form template. This also allows you to manage the form in one place and use it in many places. Have you tried that yet? If not, here's a link to a blog post that details the steps on how to admin-deploy a form template:

    Please let us know if you still encounter issues or need further assistance.

    Best Regards,

    Mel Clemente
    Qdabra® Software/
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 05-17-2010 02:15 AM In reply to

    • ujwal
    • Not Ranked
    • Joined on 05-17-2010
    • Posts 1

    An error occurred while InfoPath form was being submitted


    I m working on hosted online services. An error occurred while InfoPath form was being submitted.
     The error occur at this line of the coding : 'DataConnections["CustomListItemSubmit"].Execute();'
     I have set security and trust level at full and check the sign this form templete option.

     Above same code is finely working on local server.

     What may be the issue. Pls help me out.


    The Error is as follows :


    InfoPath cannot submit the form.
    An error occurred while the form was being submitted.

    InfoPath either cannot connect to the data source, the service has timed out, or the server has an invalid certificate.

       at Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall d)
       at Microsoft.Office.InfoPath.Internal.WebServiceConnectionHost.Execute()
       at Template1.FormCode.CTRL4_5_Clicked(Object sender, ClickedEventArgs e)
       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

  • 05-17-2010 04:31 AM In reply to

    Re: An error occurred while InfoPath form was being submitted

    Hi ujwal,

    Is this question related to a qRules command? If so, please include details concerning which command you are using and how you are using it so that we may assist you.

    If this is a question concerning custom code that you have written, please post your question in the Code board.


    Ernesto Machado
    Qdabra® Software/
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

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