How to autopopulate email address of manager field

swathivaddi
Tera Contributor

Hi,

I have a form on which manager name is a reference type field referencing to User table. (sys_user)

 

There is another field called manager email address which is setup as string field. How to get email address of the selected manager into the email address field?

 

Thank you

1 ACCEPTED SOLUTION

vermaamit16
Kilo Patron

Hi @swathivaddi 

 

You can use getReference callback with an On-Change Client Script. Refer below screenshots:

 

AmitVerma_0-1741668023185.png

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    g_form.getReference('manager', getEmail); // Change the manager field name as per your catalog item

function getEmail(manager) { 
    g_form.setValue('email', manager.email); // Change the manager email field name as per your catalog item
}
}

 

Output :

AmitVerma_1-1741668060396.png

 

Thanks and Regards

Amit Verma

View solution in original post

5 REPLIES 5

PrashantLearnIT
Tera Sage

Hi @swathivaddi 

 

Please have a look at this video for this fulfillment - 

https://youtu.be/mQt4vaX19c8?si=LuIsvqlVnUX6x50H