Issue with populating Assigned To field on Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 02:29 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:21 AM
Anyone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:24 AM
Hi @Suggy
You need to pass the sys_id for the reference field.
rec.setValue('assigned_to', sys_id_of_andrew_och);
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:31 AM
I know that 🙂
Why this works then?
rec.assigned_to = 'Andrew Och'; // THIS WORKS (without SYS_ID)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:44 AM
That article is wrt client side. I am talking about server side 🙂