Complete button should be visible on request only if all the child table is close
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I want complete button visible on request only if all the child task is complete or close where are under that parent request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
A request gets automatically closed when the SC task is closed, so I’m not sure what your exact requirement is. Please provide some more details so we can understand and guide you better.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Actually it is a custom table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
create checkAttachments function in script include and call this function in condition in UI action complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
is this a OOTB UI action or custom one?
You can use UI action condition field and call script include and that function will check and return true/false
something like this
var RequestUtils = Class.create();
RequestUtils.prototype = {
initialize: function() {},
areAllChildTasksCompleteOrClosed: function(requestSysId) {
var taskGR = new GLideRecord('sc_task');
taskGR.addQuery('request', requestSysId);
taskGR.addQuery('stage', '!=', 'Complete');
taskGR.addQuery('stage', '!=', 'Closed');
taskGR.query();
return !taskGR.hasNext(); // true means all child tasks are Complete or Closed
},
type: 'RequestUtils'
};
UI Action condition:
new RequestUtils().areAllChildTasksCompleteOrClosed(current.sys_id)
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader