Scriptable card output in VA response - Error

Shambhu K B
Giga Guru

Hi All,

 

I am having one issue where I am getting error when trying to get Accounts payable invoice case information in scripted card output from virtual agent topic. below are the details.

 

Script:

var grInvc = new GlideRecordSecure('sn_ap_cm_ap_case');
        grInvc.get(sysID);
        var title = {
            url:portalurl + '?sys_id=' + grInvc.sys_id + gs.getProperty('sn_ap_cm.ap.va.invc.card.url'),
            label: grInvc.number
        };
        var fieldList = ['number', 'category', 'state', 'comments'];
        var cardRenderer = new global.VaRecordCardRenderer(true);
        var fields = cardRenderer.createFields(fieldList, grInvc);
        var html = cardRenderer.renderCard(title, fields);
        return html;
 
Expected output: The VA should respond invoice case details in card view with 4 fields as mentioned above.
 
Actual result: VA is not giving any information about the invoice case, it just gives one blank card. please find the attached image for the reference. 
 
Did anyone face this issue with scripted response in VA card ? Any assistance would be helpful, thanks in advance.
 
#accountspayable
Regards,
Shambhu
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Shambhu K B 

you are using GlideRecordSecure so it will check ACLs on that table and user must not be passing the ACL.

Did you try using GlideRecord?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Shambhu K B 

you are using GlideRecordSecure so it will check ACLs on that table and user must not be passing the ACL.

Did you try using GlideRecord?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you Ankur, that worked. the user is supplier contact, he wont have access to backend, but same was working in dev, but not in QA, now that i have updated to GlideRecord, its working, thanks for the quick response.

regards,

Shambhu

Glad to help.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader