Delete Demand Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 12:51 AM
My story requirement is :
Implemented successfully if the open demand tasks for the demand are deleted when the demand is resetted to draft, deferred or closed.
All related demand tasks should be deleted when the demand state changes to draft, deferred or completed.
How can i do this with UI Actions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 02:58 AM
Hi @Shasia Anees ,
You want to delete them automatically upon state changed to draft, deferred or completed OR you want to delete them on clicking an UI Action button or link?
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 05:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:07 AM
Hi @anveshKumar, Can you help me with this task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:25 AM - edited 10-13-2023 04:27 AM
Hi,
I would not like to delete tasks, but make then inactive or in cancelled state. But if you want to delete then here you go:
You can write a business rule that runs as below
var delTsk = new GlideRecord('dmn_demand_task');
delTsk.addQuery('parent', current.sys_id);
delTsk.query();
while (delTsk.next()) {
delTsk.deleteMultiple();
}
PS. Make sure you test this well in dev before moving it to higher instances. Also it might be good to at least add a work note on demand that X number of tasks were deleted because state was changed.