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

Remove Task Empty Remove Task

Mon 27 Jan 2020 - 11:36
Hi
We're using
Code:

RemoveTask(“tsk_filter”);
to remove a task from the milestone plan, but have found that if we try to re-add that task, it doesn't add (no error message, it just doesn't add).
How can we remove a task but allow it to be re-added at a later time?

Thanks,Romie
________________________________________________________________________________________________________________________
Are there any actions in the Task Pane on the Left Hand side that allow you to action tasks, if there is then you are using the correct Task system. I will try and confirm the correct object name but there are two search lists one is Addin based and supports extending the Task Action Control on the Left hand side and one doesnt.
________________________________________________________________________________________________________________________
Ignore my last post that was for the other question Smile Bank holiday weekend,,,You may find that you have to update the plan to then allow you to resubmit the task filter, I haven't tried this directly but I wouldn't see any reason to not allow this to be re-added but if there was an active filter the UpdatePlan would be used to refresh all variables.
________________________________________________________________________________________________________________________
Hi Mike,Yes we think its strange too.On a particular action we have
Code:

RemoveTask(“tskFilter”);
UpdatePlan();
CurrentFile.Update();
CurrentPlan.Refresh();
And that works fine, the task is completely removed from the dbTasks table.

If we then try
Code:

AddTask(“tskFilter”);
on another action it doesn't add.Is there any other code we could use? Any delete or remove methods on a task object?
________________________________________________________________________________________________________________________
Hi Romie, The RemoveTask method only flags the task as not Active in the database. It looks as if there are some circumstances where it will delete the task from the database but that should only be happening if there is more than 1 task with the same filter on the file. There is a method
Code:

RestoreTask(“tsk_filter”)
that will mark an inactive task as active. Let me know if you need anymore information.
Regards Richard
Back to top
Permissions in this forum:
You cannot reply to topics in this forum