Set value of a Employee number instead of user id in a reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 07:23 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 08:31 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 08:46 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 10:02 AM
@Pratiksha Lang1 You can use an onChange Client script on User field and make a call via GlideAjax to get the Employee number.