How can I populate a variable in my form with the manager of a particular group?

Aditya Sinha
Tera Contributor

I have a variable which needs to be populated with the manager of a particular group as soon as the form loads. Any idea how I can attain this functionality?

7 REPLIES 7

Shruti Khaire
Kilo Sage

Hello @Aditya Sinha,

 

Did the snap or the BR help you in any way? If not, let me the issue you are facing so that I'll help accordingly.

 

Thank you!

Hi @Shruti Khaire .  I am using the onload script to set the value of the field. please let me know the issue in this as it ain't working.

 

Script

function onLoad() {
   //Type appropriate comment here, and begin script below
   var gr=new GlideRecord("sys_user_group");
   gr.addQuery("name","name of the group whose manager is needed");  /
   gr.query();
   alert(gr.manager);
   if(gr.next()){
    g_form.setValue('field of form to populate',gr.manager);
   }
   
}

Hi @Aditya Sinha ,

 

you cannot use Glide Record in client script(onload) as its not recommended and not a best practice too.

you can use Glide Ajax and create script include