0

I have created a workflow to create a task and approve that task using custom infopath form. While clicking the button Approve/Reject, the task form raises an XML exception as

"Date" is an unexpected token, the expected token is "=".

Below I have listed the stack trace of the excetion,


Server Error in '/' Application.

'Date' is an unexpected token. The expected token is '='. Line 1, position 22.

 Description: An unhandled exception occurred during the execution of the current web request.

Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details:
System.Xml.XmlException: 'Date' is an unexpected token. The expected token is '='. Line 1, position 22. 
Source Error:  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:  [XmlException: 'Date' is an unexpected token. The expected token is '='. Line 1, position 22.]   

System.Xml.XmlTextReaderImpl.Throw(Exception e) +95   
System.Xml.XmlTextReaderImpl.ParseAttributes() +5089862   
System.Xml.XmlTextReaderImpl.ParseElement() +378   
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +429   
System.Xml.XmlReader.MoveToContent() +22   
       Microsoft.SharePoint.Workflow.SPWorkflowTask.GetExtendedPropertiesAsHashtable(SPListItem task) +289   
Microsoft.SharePoint.Workflow.SPWorkflowTask.SetWorkflowData(SPListItem task, Hashtable newValues, Boolean ignoreReadOnly) +471   
Microsoft.SharePoint.Workflow.SPWorkflowTask.AlterTask(SPListItem task, Hashtable htData, Boolean fSynchronous) +110   
Microsoft.Office.Workflow.WrkTaskIPPage.XmlFormControl_OnClose(Object sender, EventArgs e) +700   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.CloseDocument(EventLogStart eventLogStart) +113   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.PlayServerMessages(EventLogStart eventLogStart) +192   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.OnDataBindHelper() +428
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.OnDataBinding(EventArgse) +97
System.Web.UI.WebControls.WebParts.Part.DataBind() +42   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
Microsoft.Office.Workflow.WrkTaskIPPage.OnLoad(EventArgs ea) +3270   
System.Web.UI.Control.LoadRecursive() +66   
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

1 Answers1

4

Try this this might work...

You must have the extended properties declaration at task create property. just add x0020 in the spaces available. The code might look like

SPTaskCreate_TaskProperties.ExtendedProperties["Start_x0020_Date"] = DateTime.Now;

and not

SPTaskCreate_TaskProperties.ExtendedProperties["Start Date"] = DateTime.Now;
kleopatra
  • 51,061
  • 28
  • 99
  • 211
Prasath S
  • 78
  • 8