Monday 6 July 2009

Hot to get Item ID in InfoPath Instantiation Form

When using an InfoPath Form as an Instantiation Form for a Workflow, the Form is loaded inside a XmlFormView WebPart.

Due to this you cannot get Query Parameters via the InputParameters (http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.loadingeventargs.inputparameters.aspx).

Instead you should add a reference to System.Web and use HttpCurrent.Context.Request.QueryString to fetch the values.

String id = HttpContext.Current.Request.QueryString("ID")

No comments:

Post a Comment