- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 04:21 AM
Hi All,
I'm trying to create a GlideRecord which looks for a unique value in a table to retrieve the Category, Subcategory and Assignment Group on our Incident form via the Service Portal.
I've created the below in the record producer script:
more_details_answer is a field that gets populated with an answers value via a client script. This value then matches a value in the u_csm_question_answer_value field in the table u_assignment_group. This table also holds the category(u_category), subcategory (u_subcategory) and assignment group (u_assignment_group) - all 3 of these are reference fields.
I want to grab the details from these 3 fields and then populate them on the Incident form.
I'm very new to scripting so any help with where I have gone wrong with the above code and also any tips on how I can debug things easier myself will be greatly appreciated.
Thanks
Sam
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 04:26 AM
in line 52 instead of using if(com.next()){
use
if(ans2.next()){
Other part of script looks good.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 08:15 AM
Thanks Mihir,
Spot on once again. I had been trying something similar but had it set on the wrong line.
Only been looking at scripts for the first time this week so apologies if some of the questions seem very basic but thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 08:19 AM
Hi Sam,
In the beginning stage you might face some issues like this in scripting.
Please go though below link and learn various scripting styles of ServiceNow.
http://wiki.servicenow.com/index.php?title=Script_in_ServiceNow#gsc.tab=0
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2017 01:22 AM
Hi sam,
try this it make sense
if (!producer.task.nil())