Assistance needed with Client Script failing.

Keang
Tera Contributor

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');
        }

 

7 REPLIES 7

saivenkates5338
Tera Contributor

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

Anurag Tripathi
Mega Patron
Mega Patron

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.

 

 

-Anurag

Hi @Anurag Tripathi 

Please see attached short clip.

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

AnuragTripathi_0-1718979176307.png

 

AnuragTripathi_1-1718979188090.png

 

-Anurag