This project is read-only.

Where to find the TaskID

Apr 21, 2009 at 10:17 PM


I would like to get the taskID of the list
I looked in the SPContext.Current.ListItem and there is a taskcollection
But how do I get the right item from the collection ?
I saw there is a workflowid property, but I don’t know where to get that ?.

Can you guys point me in the right direction ?



Apr 22, 2009 at 12:08 PM

there is no "taskID of the list". I'm not sure what exactly you mean.

There is a taskID, which you have to determine yourself when you create each task for the workflow (its a Guid)

And then there is the item that the workflow is running on, E.g. at "onWorkflowActivated", you have access to that item via the workflowProperties, which include the ItemID and ItemUrl etc.

Hope that helps.
Apr 22, 2009 at 12:36 PM


Sorry I was not clear enough but what I meant was the  taskid  from the tasklist.
But as you mentioned I can find that in the workflowproperties


Apr 22, 2009 at 4:15 PM
Just to make sure I understand the question.  Where is it that you need the task id?  Are you trying to access the task in the workflow or in the task form itself?


Apr 22, 2009 at 5:46 PM
I was trying to get the ID of the task list itself
But Jennifer answered my question :I have to look in the workflowproperties