Question

I have a share point custom web part which has 2 text box Name and ID and a button. I have a info path form called 'EmpInformation' in the form library.So if the user hits on the button, a new info path form should be opened and Name and ID fields in that form should be populated by the data send by button. any suggestions


Was it helpful?

Solution

You can use Query String parameters to send to InfoPath form and if you want no code solution, you can use Query String (URL) Filter Web Part.. Following blog shows how:

How to Pass Querystring data into an InfoPath Form

If you want to access them in code, you can access like:

// URL: http://www.foo.com/bar.xsn?xyz=1

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
   // Assign the value of the parameter 'xyz' to the string 'xyzValue'
   string xyzValue = e.InputParameters["xyz"];
}

OTHER TIPS

One idea can be to store the data in a List (maybe temporarily) and on InfoPath form make a connection to this List, get data from there.. If you have multiple entries in List and need to identify which one you should pick, you can still use QueryString approach to send the List Item Id..

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top