Pass parameters to an URL of a data connection - InfoPath Dev
in

InfoPath Dev

Pass parameters to an URL of a data connection

Last post 11-05-2012 08:17 AM by saurabh.dasgupta. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-01-2012 09:05 AM

    Pass parameters to an URL of a data connection

    Hi all, I have a scenario of an InfoPath 2007 form hosted on SharePoint (working in client mode). I need to download a the contents of a page from the same SharePoint site at the click of a button. The URL to this page expects a parameter the value of which which is to be supplied using a field on the form. I am at a loss to understand how could a URL parameter be suffixed to the URL of an existing data connection. Because of this difficulty, I managed to find the following work around using JavaScript. var xhttp=new ActiveXObject("Microsoft.XMLHTTP"); xhttp.open("GET",url,false); xhttp.send(); var response=xhttp.responseText; But, here is the challenge - the above code will throw an 'Access Denied' error on the second line, when configured with Full Trust. If I switch to 'Automatically determine security' then the JS works beautifully, but I get an annoying warning popup when using a SQL data connection on the same form. The form is signed. Any suggestions. Many thanks, Saurabh
  • 11-05-2012 08:17 AM In reply to

    Re: Pass parameters to an URL of a data connection (SOLVED)

    This snippet worked for me. I did not have to use ActiveXObject("Microsoft.XMLHTTP") and run into issues of Access Denied. var accountNumber=XDocument.DOM.selectSingleNode("//my:myFields/my:DistributorDetails/my:AccountNumber").text var url="http://sharepoint.myserver.com/sites/accounts/Shared%20Documents/views/queryAccNumDuplicates.aspx?acc=" + accountNumber; var xmlAdapter=XDocument.DataAdapters["QueryDuplicateACCNUM"] xmlAdapter.FileURL=url; xmlAdapter.Query(); var dataObj =XDocument.DataObjects("QueryDuplicateACCNUM"); var response=dataObj.DOM.xml;
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.