Friday, July 20, 2012

InfoPath Form Publishing Error

When you publish  InfoPath  form to the library, then there are chances that you get this error message

"An issue was found with the following variable 'Form.FormCode_variable'. Member variables are not supported. Use the FormState property to store data"

The main cause of this error is that somewhere in the code of form you have declared a variables and you are accessing that variables.

e.g. public string clientname="c1";

and you are using this "clientname" variable through out the form.

To avoid this use property like

public string clientname
{
get;set;
}

and use the FormState property of  InfoPath  form to use this value through out the form.

FormState property is state management technique in InfoPath forms and can be accessed in the form.

Use FormState["client"]=clientname;

and to access this use string clientname=Convert.ToString(FormState["client"]);

With the help of FormState the form will be published without any errors.

No comments:

Post a Comment