How to map a field from a record producer using scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 03:58 AM
Hi i need help with a catalog client script. i'm trying to pass a value from the record producer to the incident based on value selected by the user. I understand we cannot use current to refer to the incident form,
if ((producer.team)== 'MAC'){
g_form.setValue('assignment_group','MAC-Support');}
i need this value to be mapped to the field in incident. But this is not working.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 04:02 AM
Hi,
you can use this in producer script
if(producer.team == 'MAC'){
current.setDisplayValue('assignment_group','MAC-Support');
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
04-27-2020 05:16 AM
Thanks Ankur, let me try this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 05:19 AM
when i use current in a client script, it throws an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 05:21 AM
this didnt work.