Populate field value from a dot walked field on another table.

Michael Nash
Giga Expert

HI Guys, 

I need to Populate field value from a dot walked field on another table.

I'm trying to create a client script on the task table.

I need to stamp in the u_managing_agent value on all tasks and that information comes from the company field that is referencing the customer_account table and the value needs to be from the account_parent field in that table.

 

This is what I have so far, 

 

onChange script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var mAgent = g_form.getValue('company');
if (mAgent == '');
g_form.setValue('u_managing_agent' , 'customer_account.account_parent');
}

5 REPLIES 5

Amit Gujarathi
Giga Sage
Giga Sage

HI Machael,

Hope you are doing fine .

For the above requirement we can achieve it by using GlideReference or by using GlideAjax.

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var caller = g_form.getReference('company', SetValue); 

function SetValue(customer_account) { //reference is passed into callback as first arguments

g_form.setValue('u_managing_agent' , customer_account.account_parent);

}

Please mark answer correct or helpful if you find it useful.

 

Regards,

Amit Gujarathi


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi