Saturday, 21 September 2013

"The form cannot be submitted because of an error" in Approval Workflow

Using with Approval Workflow template i have created a workflow at Pages Library.
The problem i am having is when i add user to reviewer and CC people picker control and click on start to start the workflow it's showing me "The form cannot be submitted because of an error" error.
Initially all things were working and i was able to submit the workflow with Approvers and CC.

Solution 1:
Uninstall the update Security update for Info path 2010 (KB2553322) either 32 or 64bit for SharePoint Designer.
In my environment at control panel i didn't see this update.

Solution 2:
To verify the problem in SharePoint Designer, Site --> All Files --> _catalog --> wfpub --> Workflow Name (In my case 'Approval Workflow'). Open Approvalworkflow.xoml.wfconfig.xml and click on edit.
Here Search with xsi:nil="true" in XML code and check at WofkflowConfig --> Intitiation --> DefaultData --> dfs:myFields ---> dfs:dataFields --> <d:SharePointListItem_RW>
In my case i observed xsi:nil="true" at Assignee and CC. So Delete xsi:nil="true" in the Approvers and CC feilds 
<d:Approvers >
        <d:Assignment >
            <d:Assignee/>
            <d:Stage xsi:nil="true"/>
            <d:AssignmentType>Serial</d:AssignmentType>
        </d:Assignment >
    </d:Approvers xsi:nil="true"> <!-- instead it must be </d:Approvers> -->
    <d:ExpandGroups>true</d:ExpandGroups>
    <d:NotificationMessage/>
    <d:DueDateforAllTasks xsi:nil="true"/>
    <d:DurationforSerialTasks xsi:nil="true"/>
    <d:DurationUnits>Day</d:DurationUnits>
    <d:CC xsi:nil="true"/>        <!-- instead it must be <d:CC/> -->
    <d:CancelonRejection>false</d:CancelonRejection>
    <d:CancelonChange>false</d:CancelonChange>
    <d:EnableContentApproval>false</d:EnableContentApproval>
 Save and publish the workflow again. Now you will not see the error message.