How to get value from a reference field and copy it to the another reference field

naveenmyana
Giga Expert

Hi All,

I have a catalog item and have two reference fields, I have to get value from one reference field and copy that value to another reference field. I have tried the below script but it;s not working for me, Please suggest me the correct way here.

I have used Onload client script here...

function onLoad() {

var manager = g_form.getValue('Requesters_Manager');

alert(manager);

g_form.setValue('Resource_Manager',manager);

}

12 REPLIES 12

Hi Divya,



I have written the below Onload client script and is working fine now..Thank you so much for your help and quick response



function onLoad() {


//Type appropriate comment here, and begin script below


if(g_form.getValue('requesters_manager') !== ''){



var manager = g_form.getValue('requesters_manager');


//alert('manager');


g_form.setValue('resource_manager',manager);



}




}


Kindly mark it as correct answer, if helpful for the sake of community users to know


Hi Divya,



This question was marked as discussion, How can I make this as question as I am unable to mark it as crorect answer now