I am trying to get email address from user table using client script on my custom form. I created a reference field from the user but when I try to get the value I get the sys_id.

Wirasat
Tera Guru

I am trying to get email address from user table using client script on my custom form. I created a reference field from the user but   when I try to get the value I get the sys_id.

12 REPLIES 12

chidanandadhath
Kilo Guru

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


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


          return;


    }


    var refcc= g_form.getDisplayValue('cc');


        g_form.setDisplayValue('email', refcc);


I dont think setDisplayValue() works on client side



Please mark my response as correct and helpful if it helped solved your question.
-Thanks

yes prateek is right setDisplayValue will not work on client side either u can use getReference() or setDisplaybox('field').value


Wirasat
Tera Guru

It did not work. It picks up the user id instead of email address.


What value is stored in CC in your form??



Please mark my response as correct and helpful if it helped solved your question.
-Thanks