Problem using CreateTaskWithContentType

I recieve an error when try to set the ContentTypeId to other than 0x010801 (0x01080100D09BD90EFB3244a194C27F1CBD6D525C).

I'm able to use this contenttype when it is set as defalut in workflow.xml (TaskListContentTypeId)

Exception from wss workflow infrastructure:

System.Reflection.TargetInvocationException:>

System.ArgumentException:"Value is not from expected range"

or

System.NullReferenceException

.....

Microsoft.SharePoint.SPContentTypeId..ctor(String id) in Microsoft.SharePoint.Workflow.SPWinOETaskService.CreateTaskWithContentType(Guid taskId, SPWorkflowTaskProperties properties, String taskContentTypeId, HybridDictionary specialPermissions).

Any idea how to resolve the problem?

[834 byte] By [mansa] at [2007-12-30]
# 1

Hi,

I am having the same problem, only I'm not even getting an error message, my workflow just reports an error.

I've tried debugging, but I can't seem to step through the point of failure.

Anyone have any suggestions?

-Woody

bjorneha at 2007-10-9 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 2

Have you associated your content type with the task list? I was having a similar problem until I did that.

Robert Bogue has a good post on the subject here: http://thorprojects.com/blog/archive/2007/01/24/635.aspx

NickCox at 2007-10-9 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 3
Also, your content type ID looks wrong.

I think you need to be using 0x01080100D09BD90EFB3244a10094C27F1CBD6D525C with00 seperating the parent content type from the child. Is the content type itself working ok?

NickCox at 2007-10-9 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 4

Hi

My id is separated as follows 0x01080100D09BD90EFB3244a194C27F1CBD6D525C

I'll check the Robert Bogue post you sent, think it may be helpfull.

For now I'm using another machine to develop my contenttype workflow without presented problem.

mansa at 2007-10-9 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...

SharePoint Products and Technologies

Site Classified