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/Customer%20Equipment/NewForm.aspx?theID=(a-customer-id)
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!
localhost huh
Thanks for pointing that out 🙂