Notifications

345 views

Description

Symptoms


Advanced user criteria script with getRecord() in its logic is not working.

Record Producer cannot be submitted due to advance user criteria having getRecord

Inconsistent results in user criteria

Cause


The user is using the getRecord() method in their User Criteria script in a scoped application.

Resolution


Modify the script so that it will not use getRecord(), which is a server-side method. Use the GlideRecord() query instead, as described in GlideRecord - Client.

Example:

If your script uses something similar to this line of code:

var userSource = gs.getUser().getRecord().getValue('variable'); 

Changing it to the following resolves the issue:

var user_id = gs.getUserID(); 
var gr = new GlideRecord('sys_user'); 
gr.get(user_id); 
var userSource = gr.getValue('variable');

This is required since the getRecord() method is not supported in scoped applications.

 

Article Information

Last Updated:2019-08-02 20:54:55
Published:2019-04-05