Update reference field value to another reference field from same table

Deep_D
Tera Contributor

Hi All,

 

I'm trying to update the first reported by value to the parent field when the first reported by is not empty. using client script but the below script is not working

Deep_D_0-1688369213131.png

 

var ticket_id = g_form.getReference('first_reported_by_task',doAlert);

function doAlert(ticket_id){
g_form.setValue('parent',ticket_id.number);
 
Deep_D_1-1688369295095.png

 

 

1 REPLY 1

Aman Kumar S
Kilo Patron

Why are you using a number, its just a display value, you need to pull the sys_id, since its the reference field.
Try changin it, it will work just fine.

 

Best Regards
Aman Kumar