Written by

Barts Health NHS Trust
Question Mary George · Oct 22, 2024

How to delete an old task

Is there anyway to delete a task if the namespace associated with task is already deleted?

We have a custom purge task which is associated with an old namespace( which is already deleted) . All the option in the task details are now disabled. Is there anyway to update it or delete it? 

Thankyou for your help

Product version: HealthShare 2023.1

Comments

Julian Matthews · Oct 22, 2024

It's a bodge, but can you create a new namespace with the same name, delete the task, and then delete the namespace again?

0
David Hockenbroch · Oct 22, 2024

That shouldn't matter since the tasks themselves are not always stored in the namespace in which they are run. They are stored in IRISSYS. Does the user you are logged in as have permission to edit the %SYS.Tasks table in the IRISSYS namespace? And is this a system task? (System tasks cannot be deleted.)

0
Timo Lindenschmid · Oct 22, 2024

Have you tried deleting the task using d ^TASKMGR ? This routine is available in the %SYS namespace, and you should login to terminal/session with a user that has %All access rights.

0
Yaron Munz · Oct 28, 2024

You have other 2 options:
1. With SQL against the %SYS.Task class/table (delete from %SYS.Task where id=taskID)
2. Set sc = ##class(%SYS.Task).%DeleteId(taskID)

0