Issue with populating Assigned To field on Incident form

Suggy
Giga Sage

Need to set Assigned To field in Incident form via REST API/Business rule.

 

If I use below script,

rec.assigned_to = 'Andrew Och'; // THIS WORKS

 

but if I use below script,

rec.setValue('assigned_to', 'Andrew Och');// DOES NOT work. Why?

 

Infact everyone says use sys_id for reference fields. Then why 1st script worked? Why 2nd script failed?

 

PS - For User table, Diplay is set to FALSE for ALL the fields. 

Also in Assigned To dictionary attribute, its all EMPTY.

 

 

11 REPLIES 11

Suggy
Giga Sage

Anyone?

Hi @Suggy 

 

You need to pass the sys_id for the reference field.

 

rec.setValue('assigned_to', sys_id_of_andrew_och);

 

Regards,

Amit

Suggy
Giga Sage

I know that 🙂

Why this works then? 

rec.assigned_to = 'Andrew Och'; // THIS WORKS (without SYS_ID)

That article is wrt client side. I am talking about server side 🙂