简体   繁体   中英

How to set ContentTypeID in CreateTaskWithContentType activity using VS 2013

When I create a task with activity "CreateTaskWithContentType", I can't bind a custom ContentType with the list "Tasks".

I created a new content type and select the "Task" as parent, then added this content type to my task list.

Then I get my content type id and set the "ContentTypeID" property of "CreateTaskWithContentType" activity in the vs 2013 by this ID, and after that click on taskid property and click "bind to new member" and then "create field" inorder ro create taskid property. I also created a taskProperties for my activity.

I determine a method for invoking this activity :

        createTaskWithContentType1_TaskId1 = Guid.NewGuid();
        createTaskWithContentType1.ContentTypeId = "0x010800FEAA30385A36B042BF804D643DBC9EEF";
        createTaskWithContentType1_TaskProperties1.Title = "Approve document";
        createTaskWithContentType1_TaskProperties1.AssignedTo = @"sps2013\Modrek";
        createTaskWithContentType1_TaskProperties1.DueDate = DateTime.Now.AddDays(1.0);

But it doesn't work and after I started workflow the workflow accrued an error. Do you have any idea how I can do this ?

thanks in advance.

Here is a real useful link for creating task with content type. Click Here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM