GlideRecord on Record Producer Script

Sam Ogden
Tera Guru

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:

find_real_file.png

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

1 ACCEPTED SOLUTION

Mihir Mohanta
Kilo Sage

in line 52 instead of using if(com.next()){


use


if(ans2.next()){



Other part of script looks good.



Thanks,


Mihir


View solution in original post

7 REPLIES 7

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


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


preddy
Kilo Guru

Hi sam,



try this it make sense



if (!producer.task.nil())