This week I had a client reach out to me regarding an issue with his InfoPath 2007 form requiring the approval of an administrator to publish the form to a MOSS 2007 Form Library. I’ve been working with this client for the past couple of weeks to produce this form and he’s been able to adapt and pick up the development aspects of InfoPath forms quite well. Throughout this time, he’s been able to publish his form to the Forms Library without issue until yesterday when publishing functionality now required an administrator approval.
According to Microsoft, the following situations would require the approval of an administrator before the InfoPath form could be published to a Forms Library:
- The form template contains managed code.
- The form template requires a Full Trust security level, which allows the resulting forms to have full access to the system resources on users’ computers, such as files and settings.
- The form template uses a data connection that is managed by an administrator.
- The form template is enabled to be displayed on a mobile device.
The first option, the form template contains managed code, turned out to be the culprit. Apparently, the end user added a Button control then mistakenly clicked the “Edit Form Code” button within the properties dialog for the button. Although he never added a line of code to the form template, InfoPath 2007 created a dll which was included within the form template package and thus triggered the administrator approval requirement when publishing the form due to the form having ‘Managed Code’.
To get around this issue, you would follow this procedure:
- Click “Tools” –> “Form Options”
- Select the “Programming” category
- Click the “Remove” button
- Click “Ok” to close the Form Options dialog
These steps will remove the managed code from the form template and the form will now publish to the Forms Library on the SharePoint server as expected.