infopath submit button configuration - InfoPath Dev
in

InfoPath Dev

infopath submit button configuration

Last post 03-16-2006 01:58 PM by Matt Faus. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-14-2006 01:45 PM

    infopath submit button configuration

    Hi,
    i have my infopath form all set up receive data from an infopath database created in access aka it populates the drop down menus when you run the form for easy selection. Clear button works fine. How do i set up the submit button to submit the data collected in the form to another access database i created? Its not an available selection, this database is located on my machine along with the source database.

    thanks
  • 03-14-2006 09:08 PM In reply to

    Re: infopath submit button configuration

    Bring up your Data Connections wizard. Modifiy your data connection. On the last page of the wizard, it will give you a summary and it should tell you if your submit is enable. The following link to the how to article has good insturction for creating the Submit options.

    http://office.microsoft.com/en-us/assistance/HA011199501033.aspx

    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 03-14-2006 10:55 PM In reply to

    Re: infopath submit button configuration

    One more thing to point out is, when I first went through the excercise on above link, I didn't clear one of the fileds which uses a data type that InfoPath does not support. And subsequently, InfoPath can not connect to it. So check your primary key.
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 03-16-2006 01:21 AM In reply to

    • Joline
    • Not Ranked
    • Joined on 03-16-2006
    • South Africa
    • Posts 1

    Re: infopath submit button configuration

    Hi,
    First off I am "Brand New" to InfoPath and its scripting please help!!
    I have a standard InfoPath form with fields and a few Drop-down lists populated by a SQL database.
    What I want to do is submit all of the selected data to a stored procedure in my database which will update a table.
    I am having problems with getting my values submitted, firstly I could not get it to read the current value of my drop-down list, so I added an extra field for every dropdown, which is hidden and have a couple of rules, these fields always have the current value of the drop-down, but moment when I submit it I get the following error message: Object Required.
    I am thinking maybe my XPath synntax is wrong but I dont know???

    Here is the code of the Submit button:

    function CTRL18_7::OnClick(eventObj)
    {
    //Retrieve the value of the field that you want to use as a parameter
    //to the stored procedure.

    var emh_rr_no = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@emh_rr_no").text;
    var received_name = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@received_name").text;
    var hose_part_no = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@hose_part_no").text;
    var overall_length = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@overall_length").text;
    var Machine = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@Machine").text;
    var hose_type = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@Hose").text;
    var condition_desc = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@Condition").text;
    var origin_desc = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@Origin").text;
    var first_fitting_type = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@FittingA").text;
    var second_fitting_type = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@secondFitting").text;
    var adapter_type = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@Adapter").text;
    var comment = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info/@comment").text;

    //Set the Command for the Query Adapter of the Data Source. Incorporate the
    //parameter values that you want to use.

    XDocument.QueryAdapter.Command = "execute add_hose_info " + "'" + emh_rr_no + "',"+"'"+received_name+"',"+"'"+hose_part_no+"',"+"'"+overall_length+"',"+"'"+machine_type+"',"+"'"+hose_type+"',"+"'"+condition_desc+"',"+"'"+origin_desc+"',"+"'"+first_fitting_type+"',"+"'"+second_fitting_type+"',"+"'"+adapter_type+"',"+"'"+comment+"'";


    //Query the Data Source.
    XDocument.Query();
    }


    Thanks
  • 03-16-2006 01:58 PM In reply to

    Re: infopath submit button configuration

    You might want to check out this thread, it has some info on calling stored procedures from within JScript:
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=1863

    Also, a quick note on your code that I think might help you cut down on typing, try this:

    var hose = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:hose_info)

    var emh_rr_no = hose.selectSingleNode( "@emh_rr_no" ).text;
    var received_name = hose.selectSingleNode( "@received_name " ).text;
    // ...
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.