The CreatorCon Call for Content is officially open! Get started here.

i want to display value of assignment group in alert on making onchange in assignment group field. I am new to this , I am not able to do

Abhinab Achary1
Tera Guru

Hi All.

I have a Question

Suppose through client scripr I want to display a the aasignment group name in pop up on changing the value in assignment group field.

how do i do that

when i am doing that as

::

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

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

          return;

    }

var asd=g_form.getLabelOf('comments');

// gs.addInfoMessage(asd);

  alert(newValue);

  g_form.addInfoMessage(asd);

It is showing SYS is but not value. please help

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Here's an easy way. Use g_form.getDispayBox().value. Assigned_to and Assignment_group are reference fields. They only hold a sys_id.



// This code has been tested on Helsinki


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


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


          return;


    }


    alert(g_form.getDisplayBox('assignment_group').value);



}


View solution in original post

3 REPLIES 3

Mrinmoy Koley
Kilo Expert

Use getReference method and get the value(display value/name).



Thanks,


Mrinmoy


Chuck Tomasi
Tera Patron

Here's an easy way. Use g_form.getDispayBox().value. Assigned_to and Assignment_group are reference fields. They only hold a sys_id.



// This code has been tested on Helsinki


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


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


          return;


    }


    alert(g_form.getDisplayBox('assignment_group').value);



}


thanks Chuck,, that worked in one shot.. that too we can store that in variable .. Thanks you all for the help