Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Reset Task “Status” property Empty Reset Task “Status” property

Tue 29 Jan 2019 - 10:05
Original post by Mike Vaughan

Hi,I need to reset a task status to “Unspecified” after it has been previously completed. The property of the task object Status is read-only. Is there any way around this?

Code:
FWBS.OMS.FileManagement.Milestones.Task t = CurrentPlan.Tasks[“tsk_02_010_ResponseLBA”];
t.Status = FWBS.OMS.FileManagement.Milestones.TaskStatus.Unspecified;

thanks.


-----------------------------------------------------------------------------------------------------------------------------------------------------------

Original post by Peter Barnett

Hi Mike The status is set by our business layer and is and I would suppose that if it is unspecified then has no due date and is not complete. Try...

Code:
CompleteTask(“tsk_02_010_ResponseLBA”);
t.Due = null;

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Original post by Mike Vaughan

Hi Peter, thanks for the reply.I've tried setting the Date to null as you suggested, but because the task is set to “Completed” it seems that no property of the task can be edited. “Cannot edit task 'TP's Response to LBA' as it is currently completed.”It might be that we will need to add a seperate task pointing to the same actions?

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Original post by Peter Barnett

You'll need to Uncomplete first and commit the changes before setting the due date to null. Probably Current.Update() or UpdatePlan() beforehand.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Original post by Mike Vaughan

I would like to Uncomplete the task via the code but I'm unsure how to do this. This is the situation in the Taskflow... the LBA is sent The 'TP Response to LBA Task' is created. There is no reply from the TP, and the file is put on hold. The 'TP Response to LBA' task is Completed. The file is reviewed, and the LBA is resent. Once this Action is clicked the "TP Response to LBA" task needs to become available again. The problem is that I can't set the Task Status to Unspecified because it is controlled by the business layer, and therefore I can't change any property of the Task because it is completed. Is there another way to "Uncomplete" the task in code? sorry if I'm missing the obvious! thanks
Back to top
Permissions in this forum:
You cannot reply to topics in this forum