Skip to main content
Nintex Community Menu Bar

Sharepoint Task List Item ID

  • May 8, 2009
  • 2 replies
  • 31 views

Forum|alt.badge.img+2
Hi all,

I'm developing a process based on Sharepoint Workflow Integration... I start my workflow when a new item is created in associated list, my question is the follow:

is there a way to get the task item id generated in task list?

My goal is to delete task item in task list when my workflow ends using "Sharepoint List Item" event wizard.

Thanks

2 replies

Forum|alt.badge.img+2
  • Author
  • May 12, 2009
I resolved this problem using the workaround in the follow.

  •  I add a Datafield to my process called TaskID
  •  In my Sharepoint Workflow Integration Client, I customized the code in "- ExecuteForUser -" region:
     

    string taskIDstring = service.ModifyWorkflowAndGetTaskID(listId, listItemId, workflowInstanceId, modificationID, contextData, "");

    string taskID = taskIDstring.Split(new string[] { "?ID=" }, StringSplitOptions.None)[1];


    K2.ProcessInstance.DataFields[

    "TaskID"].Value = taskID;


    Infact ModifyWorkflowAndGetTaskId returns a string like "http://<your moss server>/Lists/Tasks/DispForm.aspx?ID=12" that is the link url to the item in the Task List
    So, when I want to modify/delete the item in the task List, I have the ID to that item



 

Forum|alt.badge.img+3

Its a good way dude...thanks lot of help


Regards


Ankur