Passing Parameters to InfoPath via Command Line - InfoPath Dev
in

InfoPath Dev

Passing Parameters to InfoPath via Command Line

Last post 01-04-2006 10:03 AM by Lewis68. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-02-2006 12:25 PM

    Passing Parameters to InfoPath via Command Line

    Hello,

    I need to pass a number(key) to an InfoPath form when opening it via Internet Explorer. I'm opening the form from within a Java web application that sends the URL to IE. "\\server\formsfolder\form.xsn"

    I was wondering if there's a way to send the form a parameter directly in the URL link. If not, is there some other way to do it?

    Thanks in advance.
  • 01-02-2006 12:50 PM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    If you are passing in a customer parameter you will need to use a simple web page. Check out this tutorial:

    http://infopathdev.com/howto/tutorials/default.aspx?i=af9e48a6e43c41f4be62296a7fa0e494




    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-02-2006 05:44 PM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Or you can use the "/aggregate" switch and a separate xmo file with the parameters. Search for "command line parameters aggregate".

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 01-03-2006 07:54 AM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Thanks for the reply.

    I'm a little new to InfoPath, so forgive the dumb questions. Im coming from a VB, C++ background.

    Does this example require the creation of an external XML file? Is there a way to pass the parameters directly?

    Here's the scenario in a little more detail.

    This whole process is happening within a multi-user Intranet environment. The form data is coming from a SQL DB and needs to be linked via a Key coming from the Java App. The key either needs to be passed directly via a parameter or saved somewhere on the local machine(not the ideal).

    Also, my form's "Merge Form" item is disabled even though I made changes to the Manifest file under importParameters. Can I just put code in the OnLoad event to read the XML file? I just need to pass one field in when the form loads.

    Any suggestions/examples would be great?

    Thanks.
  • 01-03-2006 08:07 AM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Regarding the /aggregate switch. I'm sending IE only the form template name, i.e. XSN location\filename, because I don't know where InfoPath is installed on the clients machine. Any idea's on how I could overcome this?

    Thanks
  • 01-03-2006 01:32 PM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Why don't you know where InfoPath is installed on Client's machines? Is it because you are trying to be as cross-compatible as possible?

    You could try using some system variables on the command prompt to find InfoPath, or you could add the user's install directory to the Path variable and you will have infopath.exe available everywhere.

    Reference on system variables:http://www.wilsonmar.com/1envvars.htm

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-03-2006 02:34 PM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    I'm just trying to be cross-compatible. I can't guarantee they installed it in the default location. I'm trying to make this as simple as possible.

    Question though, can I just read an XML file from a specific location during the OnLoad event without going through the Form Merge process?

    Thanks
  • 01-03-2006 03:07 PM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Could someone help me out with the merge? I'm having a bit of trouble.

    Here's the command line:
    <pathtooffice>\INFOPATH.EXE /aggregate C:\Temp\Params.xml C:\Temp\TestForm2.xsn

    Params.xml Contains.
    <?xml version="1.0" encoding="UTF-8" ?>
    <Params>
    <Param name="ID" value="Test2"/>
    </Params>

    In this next function I never get to the Merge Alert:
    function XDocument::OnMergeRequest(eventObj)
    {
    var dom = eventObj.DOM;

    if (dom.selectNodes("/Params/Param").nextNode())
    {

    XDocument.UI.Alert("Merge");

    g_fArgumentsPassed = true;
    g_argsDOM = dom;
    }
    eventObj.ReturnStatus = true;
    }

    What could I be doing wrong?

    Thanks
  • 01-04-2006 08:44 AM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Anyone?

  • 01-04-2006 10:03 AM In reply to

    Re: Passing Parameters to InfoPath via Command Line

    Here is the process in more detail. I may be going about this the wrong way.

    What happens in the process is, a form gets filled out and the data is saved to a backend database. At a latter time another user needs to be shown a slightly different form with the same data for reviewing purposes. The second user can enter data in a few new fields, but the old data should be read only. Then another user gets shown the same data for review. The process keeps going for few more users, each one entering a field or two (Comments etc.), until the end where the data should reside in the database.

    The issue is multiple users can be filling out forms simultaneously, so the data has to be kept separate using a key that's stored in the Java App. So when the users are shown a form it needs to query the database with the key and display the data.

    Another issue is, the Java App can only pass URL to Internet Explorer, so I don't believe it will accept command line parameters with spaces (/aggregate etc). Is this correct? So I'm hoping to have the Java App write an XML file to the local machine storing the key. Then have the form read the XML file in the OnLoad event and do the query.

    First, does this sound like a good way to do it, or am I missing a better way? And second, can it be done within the OnLoad event?

    Sorry for the confusion. I should have been clearer in my first post.

    I appreciate the input so far.

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