How to prevent users from closing an Incident if there are active Child Tasks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
how to prevent it using flow????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hello @MOHAMEDYASA ,
No, it is not possible, as Flows are not connected to the UI of the user and his transactions. Therefore, a flow Cannot abort a user transaction.
Use Business Rules if you want to do achieve the same.
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @MOHAMEDYASA ,
The best way to manage this use case at server level and write BR [ update] on incident table and check if there is any other active INC exist with the current INC added as parent, if record found then abort the SAVE action else SAVE it. Refer the code shared by Ankur Bawiskar.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello @MOHAMEDYASA ,
Buy using flow its not possible , you cant abort form submission using flow designer. You must use script
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord('incident_task');
gr.addQuery('incident', current.sys_id);
gr.query();
while (gr.next()) {
if (gr.state != 4 && gr.state != 3 && gr.state != 7) {
gs.addErrorMessage("Please close all incident tasks first!!");
current.setAbortAction(true);
break; // stop loop once condition met
}
}
// Add your code here
})(current, previous);like
like above Business rule .
Conditions :
state changes to resolved or
state changes to closed
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya,
Technical Consultant
