Hi,
I have created a VS 2010 Sequential workflow.
I have a custom Task List, which has few additional columns as be:
I have used the CreateTaskwithContentType option. Contenttype has some value in fieldref.
//Below data is taken while debugging on the listitem of task on the Fields data
<FieldRef Name="PercentComplete"/><Field ID="{guid}" Name="RejectReason" StaticName="RejectReason" DisplayName="Rejection Reason" Type="Text" Group="Custom Site Columns" ColName="nvarchar5" SourceID="{guid}"/><Field ID="{guid}" Name="TaskApproverComments" StaticName="TaskApproverComments" DisplayName="Approver Comments" Type="Note" Required="TRUE" NumLines="8" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" Sortable="FALSE" Group="Custom Site Columns" ColName="ntext4" SourceID="{guid}"/>
I am using the Alter Task method to update values.
Below is the code used:
Hashtable taskHash = new Hashtable(); taskHash["RejectReason"] = ddlReason.SelectedValue.ToString(); taskHash["TaskApproverComments"] = txtComments.Text; taskHash["PercentComplete"] = "1"; // this._TaskListItem contains the task list item SPWorkflowTask.AlterTask(this._TaskListItem, taskHash, true);
I have checked this:
Below is the content type, which i have associated:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"><ContentType ID="0x01080100Guid" Name="TestContentType" Group="Custom Content Types" Version="0"><FieldRefs><FieldRef ID="{guid}" DisplayName="Rejection Reason" Name="RejectReason" /><FieldRef ID="{guid}" DisplayName="Approver Comments" Required="TRUE" Name="TaskApproverComments" NumLines="8" Sortable="FALSE" /></FieldRefs></ContentType></Elements>
For the custom task list, as well as the workflow, i have used the same content type.
How to fix this?
Thanks