Assistance needed with Client Script failing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 08:55 AM
Hello,
I'm certain that the approval table contains Abel Tuter is one of the approver. However, I'm not sure why the client script is returning "Record Not Found". Please help take a look at the script. Thank you
var sysID = '1159195c8376021008469796feaad3fa'; // ritm sys id
var approverSysID = 'e12f071f833e8a1008469796feaad320'; // Abel Tuter
var approvalcheck = new GlideRecord('sysapproval_approver');
approvalcheck.addQuery('sysapproval', sysID);
approvalcheck.addQuery('approver', approverSysID);
approvalcheck.query();
var result = '';
if (approvalcheck.next()) {
result = gs.print('Record Found');
} else {
result = gs.print('No Record Found');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:06 AM
Hi @Keang
I have Tried the same code In my PDI with the help of background Script and it is working as Expected. Please check the sysid's that you are mentioning in the code.
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:06 AM
Hey KEang,
What are you trying to achieve here? The script doesn't look complete.
Can you run this in a background script and see what you get.
ALso can you show the RITM and can you see Abel Tutor as the approver there?
PS. it is not a good practice to use Glide Record in Client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 07:13 AM
Can you double check the sys_id for Abel tutor User profile too?
I just updated the sysId of the ritm(created a test record with abel tutor as approver) and user and the same script works for me