Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2021 03:13 AM
Hi
I have seen one issue with your script include. Variable 'gn' is a string and it is overridden when you are setting the analyst.
You can modify your script like this.
// modify line number 4 as below
var gn = []; // make it array type instead of string.
// After this you need set values in gn in below format.
gn.push(rec.u_system_owner);
gn.push(rec.u_analyst);
In your client side you can get the values from answer variable in below format.
// before setting values to your custom fields first give alert for answer to check if you are getting comma seprated sys ids.
alert('answer is '+answer);
g_form.setValue('u_system_analyst',answer[0]);
g_form.setValue('u_analyst',answer[1]);
Do let me know if this helps you.
Note: Please mark this answer as correct and helpful if it resolves the query and helpful alone if it lead you in right direction.
Thanks,
Mohit Kaushik
Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)
Mohit Kaushik
ServiceNow MVP (2023-2025)