locked
CreateTask in sequential flow RRS feed

Answers

  • Sorry it's my mistake.I gave display name instead of account name.It's solved.

    Thanks.


    knowledge glows
    Wednesday, May 4, 2011 6:04 AM

All replies

  • Could you share the code you are using?  I'm interested in seeing what you have for the AssignedTo value
    Tuesday, May 3, 2011 3:06 PM
  • Code:

    SPWorkflowTaskProperties spTaskProperties = new Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();

            private void TaskCreation_MethodInvoking(object sender, EventArgs e)
            {
                //SPWeb CurrentContext = SPContext.Current.Web;
                //SPFieldUserValue val = new SPFieldUserValue(CurrentContext, onListItemCreated.WorkflowProperties.Item["ApprovalUsers"].ToString());
                ////string superviser = val.LookupValue;
                //SPUser spReviewer = val.User;

                TaskCreation.TaskId = Guid.NewGuid();
                spTaskProperties = new Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();
                spTaskProperties.AssignedTo = "test\user1";
                spTaskProperties.DueDate = DateTime.Now.AddDays(1.0);
                spTaskProperties.Title = this.workflowProperties.Item.Name + " Review";
                spTaskProperties.ExtendedProperties["Comment"] = "Please review this document...";

                TaskCreation.TaskProperties = spTaskProperties;

            }


    knowledge glows
    Wednesday, May 4, 2011 5:35 AM
  • Sorry it's my mistake.I gave display name instead of account name.It's solved.

    Thanks.


    knowledge glows
    Wednesday, May 4, 2011 6:04 AM