- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi Community
i want to prevent RITM closure if it has any open tasks can this be achieved using Workflows , i can't use BUsiness rules into my instnce
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
workflows can't stop user from saving record.
So the only option is before update business rule on RITM which checks if it has any OPEN Catalog Task
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @ShaziyaS4380655 ,
For best practice, you should use Business Rule, but as you said, you don't have access to that, so please follow the approach below.
1) Add an activity "Wait for condition" in your existing workflow and use the below script.
var answer = true;
var grTask = new GlideRecord('sc_task');
grTask.addQuery('request_item', current.getUniqueValue());
grTask.addQuery('active', true);
grTask.setLimit(1);
grTask.query();
if (grTask.hasNext()) {
answer = false;
}
If my answer is useful, then mark it helpful or accept the solution.
Regards,
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
workflows can't stop user from saving record.
So the only option is before update business rule on RITM which checks if it has any OPEN Catalog Task
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
