Reassign Task

Sep 30, 2008 at 5:53 PM
I was able to use SPAspTaskForm for completing the task. Can I use it for task reassignment?
Coordinator
Sep 30, 2008 at 7:35 PM
Hi

During your last question I was on parental leave and didnt check the forum in a resonable time, sorry for that =)

You should be able to set a new assigment during modification, i.e you have to update the task.
Look into the UpdateTask/OnTaskChanged activities, they could use data provided by your taskform.

Best of luck
/Daniel
Oct 1, 2008 at 12:24 AM
Hi,
I used ModificationURL as _layouts/SpAsptaskformcontainer.aspx.

Can I call Save method in SpAsptaskformcontainer class to reassign the task?

Thank you
Anil
Coordinator
Oct 1, 2008 at 7:00 AM
Hi

I think that you should see the possibility to reassign as something you can do in your standard taskform, dont use the ModificationURL since its primary use is modification of the workflow itself.

The task lifecycle is as follows

1. task created
2. on task modified
3. evaluate if task completed, else back to 2
4. close task

If your form provide (via fields/save) you with a new assignment you could use step 3 to reassign the task

Regards,
Daniel Karlsson
Oct 3, 2008 at 1:58 PM
Hi,
 
I used updateTask, and in methodinvoking,
private void updateTask1_MethodInvoking(object sender, EventArgs e)
{
if (onTaskChanged1_AfterProperties1.ExtendedProperties["Assignedto"] != null)
{
String assignee = onTaskChanged1_AfterProperties1.ExtendedProperties["Assignedto"].ToString(); // I am able to get it from what i am setting.
if (assignee .ToLower() != Manager.LoginName.ToLower())
{
updateTask1.TaskProperties.AssignedTo =assignee ;
}
}
}
Create task
while task status{
if completed, close task.
check if its reassigned, update task. // task fails here.
}
 
But workflow fails.
Mar 17, 2010 at 10:45 AM
Edited Mar 17, 2010 at 10:46 AM

 

private void updateTask1_MethodInvoking(object sender, EventArgs e)
{
if (onTaskChanged1_AfterProperties1.ExtendedProperties["Assignedto"] != null)
{
String assignee = onTaskChanged1_AfterProperties1.ExtendedProperties["Assignedto"].ToString(); // I am able to get it from what i am setting.
if (assignee .ToLower() != Manager.LoginName.ToLower())
{

SPUser user = Web.AllUsers[assignee];
updateTask1.TaskProperties.AssignedTo =user.ID;

}
}
}

 

 

visit site: http://www.ipro.kz, http://www.mazda-club.kz