Problem with secondary data source - InfoPath Dev
in

InfoPath Dev

Problem with secondary data source

Last post 06-25-2007 07:26 AM by zullu. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-05-2007 05:31 AM

    Problem with secondary data source

    In a nutshell, here's what I'm trying to accomplish: When I launch my InfoPath form it should contact a web service that returns a list of records and populates a drop-down list.  I choose one of those items in the list and hit a button which runs the main query and fills out the rest of the form based on the selected item.

     

    I have set up a secondary data source that contacts the web service, and it will return data, but I need to pass an input parameter to that service, and that parameter should be the userID of the person who logged in.  When I set up the data connection it sees that the web service method requires a parameter and asks me to set a "sample" value.  It then uses that sample value in the query.  How do I pass the userID to the web service?  I can get the userID in the onLoad event handler, but I don't see how to get it to the data connection.  Thanks for any help you can give.

  • 06-05-2007 01:20 PM In reply to

    Re: Problem with secondary data source

    If you look at the data source of the Web service data connection you will see that it has a queryFields node. In there you will find the field that you need to set wit hthe userID. You can set this value via rules or code before actually querying the WS.
  • 06-23-2007 12:50 AM In reply to

    • zullu
    • Not Ranked
    • Joined on 06-23-2007
    • Posts 6

    Re: Problem with secondary data source

    Hi Greg,

    I am also having the issue of passing the userID to my Web Service which needs it as a parameter.

    I have 2 textbox and a button on my form, First textbox (txtUserID) displays the userid. I have created the seondary data source for the WS.

    Now, I am trying to set the rules on the button. When I click the button, it should pass the value txtUserID to the web service, get the returned value,

    and set the returned value to a second text box.

    This I am doing it this way:

    Goto Rules -> Add Rule -> Add Action -> Set A Fields VAlue -> Click the right button to the "Field" textbox -> Select the "Main" data source -> select the txtUserID -> Click OK.

    Now Click the right button (Fx) to the "Value" textbox ->  Click Insert Field or Group ->Select the "Secondary" data source, which is the WS -> Expand the queryFields ->

    select the parameter1 -> Click Filter Data -> Click Add -> In "Specify Filter condition" select parameter1 : is equal to : (Select Field or Group -> "Main" Data Source -> txtUserID).

    Click OK all the way back.

    Save the form and preview. Click on the button, but nothing happens. The web service never seem to be called.

    I have tested my web service and it works perfectly in the IIS on my server.

    Any help!!!!

    Thanks in advance.

     

  • 06-23-2007 03:58 PM In reply to

    Re: Problem with secondary data source

    Hi Zullu,

    After you add the first action, add another action that Queries the Data Source. Then it should work.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 06-25-2007 07:26 AM In reply to

    • zullu
    • Not Ranked
    • Joined on 06-23-2007
    • Posts 6

    Re: Problem with secondary data source

    Thanks a lot Patrick !!

    That worked like a charm !! You definitely saved me from knocking my heads for few more days. :-)

    If you can spare a little more time to let my concerns get a soothing comfort, I am posting my questions here.

    Please let me know if you understand and have a saying on this:

    I have a InfoPath 2003 Form. In order to write my own code while the form loads, I have created a Visual Studio 2005 project for InfoPath. While creating this project it refrenced my original fom "DataLoad.xsn" and has created its own "DataLoad.xsf" within the VS project.
    I have put some code and compiled the VS project successfully. Now I need to publish this form to a Form Library on the SharePoint portal on my server, so that many users can open and fill out this form. (I understand that users need to have InfoPath 2003 on their machine).

    Now my questions are:
    #1. Do I publish the "DataLoad.xsf" file instead of the original "DataLoad.xsn" which I used to publish earlier?
    #2. What is Trust level that the form needs to have to be accessible within the INTRANET zone?
    #3. Do I still need to digitally sign my form?
    #4. How do I eliminate the reference that is getting stored in the form, which is pointing to my local machine path from where I tried to publish the form. (I tested this by opening the Form from another user's machine- which gave an error something like "cannot open the form from MYLOCATION." Here MYLOCATION is the location of the form on my local PC.)

    Sorry for shooting out so many questions, but I need some expert comments, before I hit a dead-end.
    Can you help me to resolve any of these issues.
    Thanks in advance!!
    zullu.

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