Saurabh S
Giga Guru

This is a clear case of executing server side data from client side where you have to pull the user's info from the sys_user table as soon as the employee name is entered in the first reference field.

Instead of the on change client script, please use GlideAjax which passes parameters to the script includes, and, using naming conventions, allows the use of these parameters.

 

The below docs article from ServiceNow should be helpful.

https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/script/ajax/topic/p_AJAX.html

 

Please mark my answer correct/helpful if it helped you in any way. Thanks