Controlling the Data Connection to a Web Service - InfoPath Dev
in

InfoPath Dev

Controlling the Data Connection to a Web Service

Last post 12-17-2008 07:39 AM by m181354. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-16-2008 07:14 AM

    Controlling the Data Connection to a Web Service

    I have an InfoPath Form that you uses a Web Service Data Connection to a Sharepoint List. But only the Admin users have access to the List so the form ask for credentials when a a user opens the form to fill it out.  The Web Service is used only by the  the Admins to copy the data from the form to a Sharepoint List using Managed Code C#. 

     Is there a way to have the Data Connection not get invoked when a user opens the form but when the Admin opens the form thru a rule or would I have to use Managed Code?  If Managed Code is the only way do you have an example?

  • 12-16-2008 07:58 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Controlling the Data Connection to a Web Service

    Hello,

    We can add the rule in onLoad form using Tools -> Form Options -> Open and Save -> Rules. We have to add condition to when this rule should be executed.

    We can add Rule on button to load the secondary DOM. We can show / hide this button as per your requirement.

  • 12-16-2008 08:38 AM In reply to

    Re: Controlling the Data Connection to a Web Service

    How does the below keep the Data Connection to the Sharepoint List from not running when the form opens?  Doesn't the Data Connection automatically run when form opens?

    We can add the rule in onLoad form using Tools -> Form Options -> Open and Save -> Rules. We have to add condition to when this rule should be executed.

    I understand the below you control when a rule is created as stated below

    We can add Rule on button to load the secondary DOM. We can show / hide this button as per your requirement.

  • 12-17-2008 12:19 AM In reply to

    Re: Controlling the Data Connection to a Web Service

    Hi Steve,

    We have done this before by using two forms. One is the e-mail submit form which sends the form to the Admin. This form is a locally installed form that the users install using an MSI. The Admin installs the same form (via MSI), but on open, they see a button to submit to SharePoint which tries to submit to a hardcoded SharePoint site (Shiva's post above explains how to use On Load rules to control display/hide of the button). 

    Regarding full trust with signed certificate (separate question in e-mail). I don't recommend that since it requires an extra step from users to accept the personal certificate and it is not secure. On the other hand, it supports auto-update (whereas MSI's do not). For the split scenario, though, I recommend a locally installed MSI (this is also known as a URN based solution since the href in the xsf file does not point to a URL, but rather a URN). URN forms let you circumvent the site access error on open since it won't test the URL. Another approach is to make the e-mail version be a Restricted form - then you don't have to worry about an MSI, but since your admins need to also install the form, I'd go with an MSI. Then, the admins can submit to the ShP list (Restricted forms don't support that).

    I hope this was helpful. Good luck!

     

    Patrick Halstead
    Project Manager at Qdabra
  • 12-17-2008 07:39 AM In reply to

    Re: Controlling the Data Connection to a Web Service

    I understand about how to hide buttons to allow the Admin to copy form attribute to the Sharepoint List.  The two forms then has one with the Data Connection to the Sharepoint List(Admin) and one has it without the Data Connection to the Sharepoint List(User)...correct?
     
    But when a user emails the form to the Admin and he opens it, how does it use the template that the Admin is using with the Data Connection instead of the one without?
     
    I am using a web service that updates a Sharepoint List. The User can run with a form without this Data Connection and the Admin can run a second form with the Data Connection.  But how does the data on the form emailed to the Admin from the User get on the form that the Admin uses so he can run the web service?
     
    The problem is that the web service executes on the onLoad which causes a security error for the Users.  That is why I thought I may need to hard code the Data Connection on a form behind a button to get around this problem using Managed Code. This way the Data Connection would not execute on the onLoad.
     
    DO YOU HAVE AN EXAMPLE OF A HARDCODED SHAREPOINT SITE LIST?
     
     
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.