SharePoint Learning
Login
Signup Free
User Login
Close
 
 
Keep me logged in on this computer
Signup for a FREE user account
Close
Email
Password
Designation (optional)
First Name
Last Name
Headline (optional)
Online SharePoint training videos and articles
Price: FREE

Pass query string to a SharePoint list’s “Add new item” form that was customized by InfoPath 2010

By Lin Zhang on 20 June 14

Pass query string (e.g., a customer ID) to InfoPath form so that when the form is open, the customer with that ID in the “Customer” dropdown list is automatically selected.

Scenario:

There is a list called “Customer Equipment” and its form was customized by InfoPath 2010. One of the field is called “Customer” which is a look-up field (a dropdown list).

When add a new item I want to pass the customer ID from the URL query string like this:

http://sharepoint.thedomainname.com.au/Lists/CustomerEquipment/NewForm.aspx?theID=3

and the customer with that ID in the “Customer” dropdown list will be automatically selected.

Step by step:

Open the form in InfoPath and create a textbox in anywhere and change its name to “theID”. Then add two rules to this text box, one is to hide the text box and the other is to set the value of “Customer” dropdown list to this “theID” text box:

Submit the form to SharePoint.

Go to “List Settings >> Advanced settings” and set “Launch forms in a dialog” to “No”.

Go back to the list and click “Add new item”, then click “Site Actions >> Edit page” then “Add a Web Part”, then add the “Query String (URL) Filter” web part under “Filters”:

Open the “Open the tool pane” and put in the parameter name “theID” and click OK:

Connect the filter to InfoPath form:

Close and get out of the “Edit Page” page and it’s done!

Comments:

No comments.

Copyright © SharePointLearning.net.au. All Rights Reserved | Contact Us

Powered by DigiLife Studio