The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to populate the manager based on requested for?

Manasa44
Kilo Contributor

Hi,

How to populate the manager based on requested for?

 

5 REPLIES 5

mr18
Tera Guru
Tera Guru
If manager field is on RITM then create before insert business rule current.field_name = current.request.requested_for.manager;

Pooja Mallikarj
Tera Guru

Hi,

You can do this via onChange catalog client scirpt.

Select the variable name as Requested For

And UI type as ALL

write below lines of code in script field.

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

//Type appropriate comment here, and begin script below
var user=g_form.getReference('requested_for',doAlert);
function doAlert(user)
{
g_form.setValue('manager',user.manager);
}


}

Thanks,

Pooja M

Hi Pooja,

I created above catalog OnChange client script but auto populating only sys_id of Manager.

Pooja Mallikarj
Tera Guru

Hi,

Hope you are doing good.

If you find my response as correct and worthy please mark it as correct and close the thread.

Thanks,

Pooja M