Getting Undifened in a field

hema sundar
Tera Contributor

Hello community i have written a client script to set value of field from  a reference field but i am getting undefined in that  field . Here is the script 


ar getOEM = g_form.getReference('vendor', setTeamandCategory);
function setTeamandCategory(getOEM) {
if (getOEM)
g_form.setValue('u_team_category', getOEM.u_team_category);
g_form.setValue('contract_administrator', getOEM.contact);
}

 

hemasundar_0-1703748748644.png

 

6 REPLIES 6

Anil Lande
Kilo Patron

Hi,

Have you selected vendor on contract form?

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

No , "vendor" is the backend value of a OEM field 

Rakesh18081
Tera Expert

I assume this is on 'On Change' client script and also You are changing the vendor .If these are taken care of then I see that first Line of your code should be var and not ar

"var getOEM = g_form.getReference('vendor', setTeamandCategory);"

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.

SunilKumar_P
Giga Sage

Hi @hema sundar, I see OEM field is empty and that need to be populated as you are dotwalking that field.

 

Regards,

Sunil