- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 12:47 AM
When a case is created using a record producer, we want the name of the producer to be updated in one of the custom field on the case form.
Solved! Go to Solution.
- Labels:
-
Multiple Versions
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 12:19 AM
Hi,
you mentioned your custom field is reference to sc_cat_item_producer table
So you just had to use this and use correct field name
cat_item.sys_id -> gives sysId
current.u_customField = cat_item.sys_id;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 01:07 AM
Hi,
you can use this in record producer script
current.u_customField = cat_item.name;
OR
if that doesn't work then use this
var gr = new GlideRecord("sc_cat_item_producer");
gr.addQuery("sys_id", cat_item.sys_id);
gr.query();
if (gr.next()) {
current.u_customField = gr.name;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 02:04 AM
Hi
Both of the codes didnt work, May be i should have mentioned that this custom field is a reference field and is referring to "sc_cat_item_producer_list" table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 07:29 PM
then just do this
current.u_customField = cat_item.sys_id;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 12:43 AM
Hi Ankur,
We are avoiding using sys id in scripting.
Rgeards,
Ravikiran