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

SAI VENKATESH
Tera Sage
Tera Sage

Hi @Keang 

 

I tried executing Your Code In my PDI Instance in the background script, and it is working fine. Please check again the sysid's that you have mentioned in the script.

 

Thanks and Regards

Sai Venkatesh

Hi @SAI VENKATESH 

Please review attached clip

 

KevinBellardine
Kilo Sage

Hey @Keang 

 

If this isn't working in your instance then I'm guessing you're running it from a scoped application. Client side GlideRecord doesn't work in Scope, and even though it's available it really shouldn't be used in Global either. You'll have to use a GlideAjax.