Script include for advanced reference qualifier

petterbj_rgmo
Tera Contributor

Hello experts

I am facing a issue with a script include I am using in for a advanced reference qualifier. The customer I am working with is using the Service Desk Call application. If they the Call type is set to incident, they should be able to choose a service, a category and a subcategory. Currently I have a reference field (Category and Subcategory) that is doing a lookup on the sys_choice table. In the script include I have added a query to get all the relevante categories and returning them, but the reference field is not populated. Pictures to follow:

Script include:
find_real_file.png

Catefory reference specification:

find_real_file.png

Category field specification:

find_real_file.png

Can anyone assist me in finding my error? Do I have to return something else than the label?

1 ACCEPTED SOLUTION

Geoffrey2
ServiceNow Employee
ServiceNow Employee

Your script might be stopping when it hits the undefined 'current' on line 11.   Try passing current as another argument when you call your function.



This is how I would define the Script Include.   Then call it with javascript: new GSS_Call_Categories().getRefQual(current)



Capture.PNG


View solution in original post

15 REPLIES 15

Current configuration:



find_real_file.png


find_real_file.png


It looks good... Is it working?


Yes, thank you so much!!


I do not think it should work.



string_return is collection of labels, but you are returning   sys_id's with labels.



Instead of obj.label you should push obj.sys_id.




Thanks,


Jagarnath


That is true, I also had to change that.