Tag Archive for InfoPath

Debugging InfoPath Browser Form

If you’re using custom code with your browser enabled InfoPath forms and would like to be able to debug them, follow the steps outlined below to configure the form to enable this.

Open the Visual Studio Tool for Applications(VSTA) editor with the code behind for your InfoPath form. In the solution explorer pane, right click your project and select Properties.

Switch to the Build tab and click the Advanced button:

Advanced Button
Read more

Register Code Behind InfoPath Form for Web Browsing

This post describes how to deploy a web browser compatible InfoPath form, with code-behind, through a SharePoint feature.

Installing and registering an InfoPath form, along with a custom content type is pretty straight forward once you know the required steps.

Start by creating a content type that inherits from the Forms type. The following is a sample content type’s markup.

< ?xml version="1.0" encoding="utf-8"?>
<elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <contenttype ID="0x0101010076AEDEA7CA2A44B59ECB3D491618E052"
        Name="Custom Form CT"
        Group="Custom"
        Inherits="TRUE"
        RequireClientRenderingOnNew="FALSE"
        Version="0">
    <fieldrefs>
    </fieldrefs>
    <documenttemplate TargetName="/FormServerTemplates/CustomForm.xsn"></documenttemplate>
  </contenttype> 
</elements>

Read more

InfoPath Object Reference not set Error

After designing an InfoPath form and as you try to upload and register the form to SharePoint, through the Central Administration site for example, you may see the following error:

Object reference not set to an instance of an object

You may also see the following error when previewing the form within InfoPath Designer:

InfoPath cannot open the selected form. There was an error while loading the XML Schema for the form.

Read more

Form template failed to load

If you’re working with an InfoPath form and are trying to display it as a web enabled form but are getting errors saying the form template failed to load, it may just be due to the manifest for the XSN not containing the relative URL base.

For the following ULS errors:

The form template failed to load. (User: …., Type: NullReferenceException, Exception Message: Object reference not set to an instance of an object.)
and
Unhandled exception when rendering form System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.
UrlIsSameFileOrSamePath(String absoluteFileUrl, String baseFileOrFolderUrl)….

These are due to the XSN not having the base URL defined, which can be resolved by updating the manifest.xml with the following element:
Read more

Programatically register InfoPath form for Web Browsing in SharePoint

A topic that is not particularly well document with SharePoint is how to deploy a web browser compatible InfoPath form via a feature.

Deploying a form through the Central Administration site provides such a form. This isn’t much use if you want to make the package that you ship to a client installable without involving some manual steps.

Installing and registering an InfoPath form, along with a custom content type is pretty straight forward once you know the required steps.

Start by creating a content type that inherits from the Forms type. The following is a sample content type’s markup.
Read more

Follow

Get every new post delivered to your Inbox

Join other followers: