Can I submit a field and the entire form to a ws? - InfoPath Dev
in

InfoPath Dev

Can I submit a field and the entire form to a ws?

Last post 08-07-2006 01:10 AM by larniel. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-04-2006 07:33 AM

    Can I submit a field and the entire form to a ws?

    Hi all,

    I am a newbie in InfoPath and JS. After read through the entire forum, I still don't know how to solve the problem I encountered.
    Please kindly help me on it.

    I need to submit an entire form to a webservice.
    However, a field of the form must be sent to the webservice at the same time. Namele, the webservice has to get the content of a field of the entire form submitted.

    Probably there are 2 solutions:
    1. Just submit the entire form, and the WS parse the XML string to get the field information. But take into consideration the performance, I'd prefer the second solution.
    2. Customize a button to submit the entire form together with the field to the WS.
    Is it possible to manage it by some JS codes? If yes, how?

    Many thanks!
  • 08-05-2006 01:28 AM In reply to

    Re: Can I submit a field and the entire form to a ws?

    Hi,

    Check out this link, you can get some information.

    http://infopathdev.com/forums/topic.asp?TOPIC_ID=2173

    I hope this will help for you,
    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 08-07-2006 01:10 AM In reply to

    Re: Can I submit a field and the entire form to a ws?

    Thanks for your reply.
    I read this post, but I don't think that the replies to that topic give a pratical solution, at least a solution to my question.

    I customized a button and wrote the following JS codes:
    function CTRL4_5::OnClick(eventObj)
    {

    //Get a reference to the Web Service data connection
    var dataObject;
    dataObject = XDocument.DataObjects.Item("wsConn");
    //Set the SelectionNamespaces property so you can navigate the web service XML()
    dataObject.DOM.setProperty("SelectionNamespaces", "xmlns:dfs=\"http:/schemas.microsoft.com/office/infopath/2003/dataFormSolution\"" + "xmlns:tns=\"http:/tempuri.org/\"");

    //Get a reference to the parameter in the web service
    var xml;
    xml = dataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:wsConn/tns:INPUTDATA");
    xml.text = XDocument.Dom.xml;

    var num;
    num = XDocument.DOM.selectSingleNode("/FAQ/num");
    var id;
    id = dataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:wsConn/tns:NUM");
    id.text = num.text;

    dataObject.QueryAdapter.Query();
    }


    Here, wsConn is a websevice connection defined in Data Connections. Is it right?
    If yes, why that when I click this button, error occurs with the message "An item with the following index does not exist in the collection: wsConn
    File:script.js
    Line:27
    "?

    Many thanks!


    quote:
    Originally posted by K.Ramana Reddy

    Hi,

    Check out this link, you can get some information.

    http://infopathdev.com/forums/topic.asp?TOPIC_ID=2173

    I hope this will help for you,
    Thanks.

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