Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

I'm new to sharepoint 2010. in my organization they given one small workflow to do.
I created the state machine workflow in visual studio and deployed in sharepoint .

i used create task to create task by default content type.But now i want to use createtaskwithcontenttype.I replaced createtask with createtaskwithcontenttype and also gave the contenttype id.but when i deploy that its showing error occured in workflow.
Please help to resolve this i am struggling to resolve this issue.

this is the code in createtaskwithcontenttype invoking:

C#
private void createTaskWithContentType1_MethodInvoking(object sender, EventArgs e)
        {

            createTaskWithContentType1_TaskProperties1 = new SPWorkflowTaskProperties();
            createTaskWithContentType1_TaskId1 = Guid.NewGuid();
         //   createTaskWithContentType1_ContentTypeId1 = "0x0108003A026B8335DC724AAA9A3A7D81A12F5B";
            createTaskWithContentType1_TaskProperties1.Title = "Approve Document(CType)";
            createTaskWithContentType1_TaskProperties1.AssignedTo = @"domain\name";
            createTaskWithContentType1_TaskProperties1.DueDate = DateTime.Now.AddDays(1.0);
        }


thanks and regards,
jyothi
Posted
Updated 12-Jul-13 6:08am
v2
Comments
ZurdoDev 12-Jul-13 12:08pm    
You need to get the details of the error.

1 solution

I see that i have used content type "0x0108003A026B8335DC724AAA9A3A7D81A12F5B", it starts with 0x010800xxx. This is the content type id for standard task content type.

If it is workflow task it should start with 0x01080100xxxxxxxxx

I updated content type to derive from workflow task content.
So now my content type id is 0x010801003A026B8335DC724AAA9A3A7D81A12F5B...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900