We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

how to get value of assignment group

kabi
Tera Contributor

I created this client scripts on the incident table.

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

var abc=g_form.getValue('assignment_group');
      alert(abc.Name);
   
}

Everytime we changes the value in assignment group I want to show that value in alert. Right now its showing the sys_id value.

Please help

1 ACCEPTED SOLUTION

User179407
Mega Guru

try this




function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


  return;



  }


  var abc = g_form.getDisplayBox('assignment_group').value


  alert(abc);


}


View solution in original post

9 REPLIES 9

User179407
Mega Guru

try this




function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


  return;



  }


  var abc = g_form.getDisplayBox('assignment_group').value


  alert(abc);


}


??



from where did you get 'getDisplayBox' method??


kabi
Tera Contributor

it works, but how come I do not see this method on wiki?


It most likely is not fully supported and not within best practices.   See below for the correct method:


http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#getReference