Consider the following scenario in Microsoft InfoPath Designer 2010:
You add a Person/Group Picker control to a form.
You add an event listener code to one of the data field nodes that were created for the Person/Group Picker control. The event listener code is contained in the Microsoft InfoPath 2010 form template as a sandboxed code.
The form template is published to a Microsoft SharePoint Server 2010 Web site.
Note The InfoPath form code that is contained in the form template runs by using the SharePoint Foundation Sandboxed Code service if the Administrator-approved form template (advanced) option is not enabled when the form is published.
After the form is published, you make a change to the Person/Group Picker control on the form.
In this scenario, the event listener is not triggered.
This issue occurs because the Person/Group Picker control does not trigger sandboxed code events except when the changes are made programmatically to the values in the control by other coded routines in the form.
To work around this issue, redeploy the InfoPath 2010 form as an administrator-approved form. To do this, follow these steps:
Open the InfoPath 2010 form in Design mode in InfoPath Designer 2010.
On the File menu, click Publish.
Click SharePoint Server.
Follow the instructions in the Publishing Wizard to finish the publication. Make sure that you select the Administrator-approved form template (advanced) option.
Open SharePoint 2010 Central Administrator on a SharePoint Server 2010 server that has InfoPath Forms Services enabled.
Under Central Administration, click General Application Settings.
Under InfoPath Forms Services, click Upload form template.
Click Browse, locate the InfoPath 2010 form template, and then click Open.
Click Upload, and then click OK.
Click General Application Settings, under InfoPath Forms Services, click Manage form templates.
Click the name of the template that you uploaded, and then click Activate to a Site Collection.
Click the Site Collection drop-down list, and then click Change Site Collection.
Select the URL of the site collection where you want to enable the form template, and then click OK two times.
Open the site collection where you enabled the form template.
Create a new form library on the site.
On the Library tab, click Library Settings.
Under the General Settings section, click Advanced settings.
Set Allow management of content types to Yes, and then click OK.
In the Form Library Setting page, click Add from existing site content types.
Click the form template that you enabled, click Add, and then click OK.
Click Form, click Delete this content type, and then click OK.
Open the form library. On the Documents tab, click New Document, and then click the form template name.
For more information about how to deploy form templates, see the following MSDN article: