Tuesday, August 3, 2010

InoPath 2010 Forms Not Working in SharePoint 2010

I created a new InfoPath form (not very well, but serviceable).  When I tried to publish the form to a SharePoint 2010 Server, I received the following error message:


The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

After some research I was able to figure out that the State Service was not set up to allow InfoPath Forms to be stored or rendered within SharePoint.  I wasn't able to find a way to do this through the GUI so I resorted to the SharePoint 2010 Management Shell (PowerShell).
  •     Run the SharePoint Management Shell as an Administrator. - Start ->  All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell
  • After the module(s) load and you have a prompt, type:  $serviceApp = New-SPStateServiceApplication -Name “State Service”
    The command will execute and you'll be returned to a prompt.
  •  Type: New-SPStateServiceDatabase -Name “StateServiceDatabase” -ServiceApplication $serviceApp
    This creates a state server database and service application.  You will see the name of the service database, the ID (in the form of a long string of characters) and the type presented in the PowerShell window
  • Type: New-SPStateServiceApplicationProxy -Name “State Service” -ServiceApplication $serviceApp -DefaultProxyGroup
    This creates a State Service Application Proxy
The screenshot below shows the commands and the expected output.

You should now be able to publish your InfoPath form to SharePoint.