Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Calculated Dictionary Entry

jonathangilbert
Mega Sage

Hi,

Can someone please explain where I am going wrong on the below calculated script that I am entering in the Dictionary Entry:-

 

 

(function calculatedFieldValue(current) {

    var manager = new GlideRecord('u_employee_number');
    manager.addQuery('u_employee_number', current.u_line_managers_employee_number);
    manager.query();

    return manager.u_user_record_has_ad_account.sys_id;  // return the calculated value

})(current);
 
 
What I want is the "Line Manager" referenced field to be populated using the Line Managers employee Number as a lookup query.  
 
Many Thanks
 
1 REPLY 1

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @jonathangilbert please check table name is correct or not