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

Did you make the client callable true. Because if it is true it looks like below:



Capture.JPG


And if it false it will look like below:



Capture1.JPG



Yours one look like client callable is true. Make it false. and it should be like the last image.


So it needs to be client callable?


It needs not to be client callable.


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


I removed the code at line 11, as I was not using it. I am passing current.u_internal_service as an argument in the function.
Will update script include accordingly and give you a update.