Client script working in UI16 - ITIL view but not in workspaceIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } There is a client script which is trying to clear the caller field on change of another field. Below is the sample script. On change of a custom field we are trying to clear the 'caller_id'. This is working fine on the UI16- ITIL view form, but not on the Agent workspace. function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } var ga = new GlideAjax('GetAccountDetails'); ga.addParam('sysparm_name', 'getAccount'); ga.addParam('sysparm_fieldID', g_form.getValue('u_customField')); ga.getXML(populateAssn); function populateAssn(response) { var answer = response.responseXML.documentElement.getAttribute('answer'); var oldFieldValue = g_form.getValue('company'); if (oldFieldValue != answer) { g_form.setValue('company', answer); // var clr = g_form.getReference('caller_id'); //Commenting this //Get the caller object so we can access fields var caller = g_form.getReference('caller_id', callBack); g_form.clearValue('caller_id'); } } } Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All release Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } This issue is happening because of using the getReference() API without any callback function in the onChange Client Script. We need to use a callback function for getReference() method instead to make it work on Agent workspace/Service Portal: Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Replace the script with below: =================================================================== function onChange(control, oldValue, newValue, isLoading, isTemplate) {if (isLoading || newValue === '') {return;}var ga = new GlideAjax('GetAccountDetails');ga.addParam('sysparm_name', 'getAccount');ga.addParam('sysparm_fieldID', g_form.getValue('u_customField'));ga.getXML(populateAssn);function populateAssn(response) {var answer = response.responseXML.documentElement.getAttribute('answer');var oldFieldValue = g_form.getValue('company');if (oldFieldValue != answer) {g_form.setValue('company', answer);// var clr = g_form.getReference('caller_id'); //Commenting this//Get the caller object so we can access fieldsvar caller = g_form.getReference('caller_id', callBack);//Nested 'getReference' callback function for variable accessfunction callBack(caller) {if (oldFieldValue == caller.company) {alert('inside');g_form.clearValue('caller_id');}}}}}=================================================================== Now, the Caller field is cleared as expected in Agent Workspace as well. Reference: https://community.servicenow.com/community?id=community_question&sys_id=5eb2377edbf57bc0d58ea345ca9619c4 https://community.servicenow.com/community?id=community_question&sys_id=a78c62e3db29e300107d5583ca9619f7