Set value of a Employee number instead of user id in a reference field

Pratiksha Lang1
Kilo Sage

Set value of a Employee number instead of user id in a reference field, The employee number field is in scoped application and it is referencing to the sys_user table to get the employee number. Since it is in scoped application I am not able to override the display value. Please help me with the solution on this if this can be achieved with scripting or any other way.

 

PratikshaLang1_0-1697466196787.png

 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@Pratiksha Lang1 Try creating a Client callable Script Include in the scope in which Employee Number field is defined. Allow the access of Script include from all the scopes. From a client script, fetch the value of employee number on the basis of the sys_id of the logged in user, populate the same with help of g_form.setValue('field name',value');

 

Hope this helps.

I don’t want to set the value of employee number on the basis of logged in user. If any other user is selected then it should set employee number of that user

@Pratiksha Lang1 You can use an onChange Client script on User field and make a call via GlideAjax to get the Employee number.