I need to set value in reference variable based on other reference variable.

varma2
Mega Sage

Hi All,

 

I need to set value in reference variable based on other reference variable.   

Below is the client script in log i can see the value but it's not set in reference varible.

 

function onChange(control, oldValue, newValue, isLoading) {

if(isLoading || g_form.getValue('device_name')!= '')
{
var mn = g_form.getReference('device_name', callback);
}
}

function callback(mn) {
    
      
g_form.setValue('device_serial', mn.serial_number);
    alert('Value='+ mn.serial_number);
}

Please suggest.

Thanks all.

 

5 REPLIES 5

Martin Ivanov
Giga Sage
Giga Sage

Hi. If my answer has helped you resolve your issue, Please mark Correct and Helpful. This way, other users may also benefit from the thread. Thanks!
Martin Ivanov
Community Rising Star 2022


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024