how to set approvers to no longer requested when parent ritm is cancelled
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
02-28-2025 04:06 AM
Hi can anyone please help me with code correction for written below:
requirement is that when the parent RITM is cancelled for the catalog item, the approvers need to be set to ' no longer requested' for the child RITM'S
wriiten an after business rule and code is :
if (current.state == 'Canceled' && !current.parent.nil())
{
var parentRITM = current.parent;
var grChildRITMs = new GlideRecord('sc_req_item');
grChildRITMs.addQuery('sgdc_ref', current.request);
grChildRITMs.query();
while (grChildRITMs.next()) {
if (grChildRITM.state ! = 4)
grChildRITM.state = 4;
ChildRITM.update();
}
var grApprovals = new GlideRecord('sysapproval_approver');
grApprovals.addQuery('document _id', grChildRITMs);
grApprovals.addQuery('state', '!=', 'closed');
grApprovals.query();
while (grApprovals.next()) {
grApprovals.state = 'not_requested';
grApprovals.update(); } }
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
02-28-2025 04:31 AM
Hi @raj765_32 ,
What's the issue you are facing here?
Have you tried to debug your code if your BR is not executing as per the requirement?
Regards,
Rohit
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
02-28-2025 04:40 AM
hi rohit,
BR is working till approver but from approver it is not working need help with code corrections
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
02-28-2025 04:35 AM
verify through what approval getting triggered whether is workflow or flow once verify use rolledback activity, Set Record action respectively.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
02-28-2025 04:40 AM
hi @Nilesh Pol it is getting triggered with workflow only,
