Pages

Tuesday, January 26, 2010

SPWorkflow AlterTask didn’t work with hash table which has space into key name

While creating hash table for passing into altertask method, we need to be very careful, because it didn’t like spaces into key name, we need to put our key without spaces.

Sample Code:

taskHash["UserInputField"] = UserInputField.Text;

taskHash["UserInputField_ForHash"] = UserInputField.Text;

taskHash["Status"] = "Completed";

taskHash["Status_ForHash"] = "Completed";

SPWorkflowTask.AlterTask(taskListItem, taskHash, true);

Reference Link:

http://www.databaseforum.info/10/1131769.aspx

2 comments:

  1. Hello Sanket,

    I had a similar problem, in my case there were special non-english alphabet characters which caused that task was not updated, I made a small posting on my blog:

    http://honga.super6.cz/2009/12/sharepoint-altertask-method-problem.html

    ReplyDelete
  2. Hi Honga,

    Its good to know about different cause of same problem, I have looked into your blog regarding same problem, you really explained it very well.

    Thank you,
    Sanket

    ReplyDelete