CSM/FSM workspace client script

eyal abu hamad
Mega Sage

Hi all,
I have client script that works fine in the backend view, but in worksapce it kicked the client script but didn't enter the glide record

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

	var group = g_form.getValue("assignment_group");
// 	if(group != ""){
// 		g_form.setMandatory('work_notes', true);
// 	}
	var flag = false;
	
	var gr = new GlideRecord("sys_user_group");
	gr.addQuery("sys_id", group);
	gr.query();
	if (gr.next()) {
		if(gr.u_tier == 1){
			flag = false;
		} else if(gr.u_tier == 2){
			flag = true;
			
		} else if(gr.u_tier == 3){
		flag = true;
			
		}
	}
	
	g_form.setMandatory('service_offering', flag);
	

   //Type appropriate comment here, and begin script below
   
}
1 REPLY 1

Shruti
Mega Sage
Mega Sage

Hi,

Please do not use GlideRecord in client scripts

Best practice is to use GlideAjax in client script