HR Agent Workspace Fields likeCategory and Subcategory are not Auto populating with Hr Service Field.DescriptionSteps to handle for auto population of Category and Subcategory in HR agent work space.Steps to Reproduce 1.Plugin needs to installed:com.sn_hr_corecom.sn_hr_agent_workspace2.Go to sn_hr_core_case_total_rewards.list and open any record which is in ready state.3.Configure form lay out and add these below field in the workspace view:Hr ServiceTopic categoryTopic detail4.Save it.5.Select Any HR Case from sn_hr_core_case_total_rewards.list6.Remove Topic Detail (Subcategory) and Topic category (Category) from the HR case.7.Select a New HR Service:Actual behavior :Topic Detail (Subcategory) and Topic category (Category) should get automatically populated but in HR workpspace the autopopulation is not working for Topic Detail (Subcategory) and Topic category (Category) fieldExpected behavior:The topic detail and topic category should auto popukate when we choose the HR service .This is working as expected in platformThe client script which is doing this autopopulation is"Set Fields from selected Service"Actual behaviorWorkaroundWorkaround Steps for Agent workspace Step 1: 1: Open Client Script with the name “Show HR service fields”. 2: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecordSet(tableName, "sys_id=" + serviceId, setServiceDisplay); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecordSet(tableName, "sys_id=" + serviceId, setServiceDisplay); }); }else{ g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecordSet(tableName, "sys_id=" + serviceId, setServiceDisplay); }); } 3: Click Update. Step 2: 1: Open Client Script with the name “Set Fields from selected Service”. 2: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_service', newValue, setFieldsFromService); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_service', newValue, setFieldsFromService); }); } else { g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecord('sn_hr_core_service', newValue, setFieldsFromService); }); } 3: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', hrService.topic_detail, setTopicCategory); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', hrService.topic_detail, setTopicCategory); }); } else { g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecord('sn_hr_core_topic_detail', hrService.topic_detail, setTopicCategory); }); } 4: Click Update. Step 3: 1: Open Client Script with the name “Set Topic Category when Detail selected”. 2: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_service', g_form.getValue('hr_service'), checkHrService); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_service', g_form.getValue('hr_service'), checkHrService); }); } else { g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecord('sn_hr_core_service', g_form.getValue('hr_service'), checkHrService); }); } 3: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', newValue, setTopicCategory); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', newValue, setTopicCategory); }); } else { g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecord('sn_hr_core_topic_detail', newValue, setTopicCategory); }); } 4: Click Update. Step 4: 1: Open Client Script with the name “Clear Topic Detail & Svc on Topic Change”. 2: Find & Replace below snippet. ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', g_form.getValue('topic_detail'), checkTopicDetail); }); with if(typeof ScriptLoader !== "undefined"){ ScriptLoader.getScripts('sn_hr_core.utils_ui.jsdbx', function() { getGlideRecord('sn_hr_core_topic_detail', g_form.getValue('topic_detail'), checkTopicDetail); }); }else{ g_ui_scripts.getUIScript('sn_hr_core.utils_ui_ws').then(function(uiScript) { uiScript().getGlideRecord('sn_hr_core_topic_detail', g_form.getValue('topic_detail'), checkTopicDetail); }); } 3: Click Update. Step 5: 1: Create new UI Script Name: utils_ui_ws UI Type: Mobile / Service Portal Application: Human Resources: Core 2: In script block paste below code: (function() { "use strict"; function _ajaxRecordSet(tableName, query, sysparmName, process){ try{ function getResponse(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); return process(JSON.parse(answer)); } var ga = new GlideAjax('hr_CaseAjax'); ga.addParam('sysparm_name', sysparmName); ga.addParam('sysparm_tableName', tableName); ga.addParam('sysparm_query', query); ga.getXML(getResponse); } catch(e){ console.warn('error in ajaxRecordSet: ', e); } } return { getGlideRecord: function(tableName, query, process){ _ajaxRecordSet(tableName, query,'getGlideRecordSecureDataWS', process); }, getGlideRecordSet: function(tableName, query, process){ _ajaxRecordSet(tableName, query, 'getGlideRecordSecureSetDataWS', process); }, type: 'utils_ui_ws' }; }) 3: Click Submit. Step 6: 1: Open Script Include with the name "hr_CaseAjax" and paste the below code after line number 711. getGlideRecordSecureDataWS: function () { var table = this.getParameter('sysparm_tableName'); var query = this.getParameter('sysparm_query'); var gr = new GlideRecordSecure(table); if (gr.get(query)) return new global.JSON().encode(this._getData(gr)); else return new global.JSON().encode(false); }, getGlideRecordSecureSetDataWS: function () { var records = []; var table = this.getParameter('sysparm_tableName'); var query = this.getParameter('sysparm_query'); var gr = new GlideRecordSecure(table); gr.addEncodedQuery(query); gr.query(); while (gr.next()) records.push(this._getData(gr)); return new global.JSON().encode(records); }, 2: Click Update.Related Problem: PRB1480446