advanced referene qualifier

Eli7
Tera Expert

Hi All,

 

I have an advanced ref qualifier and I am calling a SI 

Javascript:new NewIPC().getIPCServersForCurrentUser(current.variables.req_for);

 

In my SI I am not sure how to receive or map the var req_for. I am only trying this because in my AJAX call it return the expected values but also other record form the CMDB_CI and I am not quite sure why.

 

Any input appreciated.

1 ACCEPTED SOLUTION

I missed earlier that it looks like you are capitalizing the J.  It's hard to tell with this editor substitutions, but it should look like this:

BradBowman_0-1728479573655.png

Confirm the reference table for this variable is cmdb_ci_server, and that have a variable named req_for that is a reference to sys_user, then you should see the selected user sys_id logged in the Script Include.  If the logic in the SI is correct, you should see the correct records logged before the return, then the same should show in the list on the reference variable.  None of this is using or requires AJAX or a Catalog Client Script.

View solution in original post

14 REPLIES 14

I missed earlier that it looks like you are capitalizing the J.  It's hard to tell with this editor substitutions, but it should look like this:

BradBowman_0-1728479573655.png

Confirm the reference table for this variable is cmdb_ci_server, and that have a variable named req_for that is a reference to sys_user, then you should see the selected user sys_id logged in the Script Include.  If the logic in the SI is correct, you should see the correct records logged before the return, then the same should show in the list on the reference variable.  None of this is using or requires AJAX or a Catalog Client Script.

omg, I am so glad I have you, now it works. I just didn't see the big J

palanikumar
Mega Sage

Hi,

Suggest you not to use same function for GlideAjax and Ref qualifier as the input parameters are passed differently for GlideAjax and Ref Qualifier.

Within Script include create new function with parameter as required. Use this parameter in you script. Share the script include if you have any confusion, I can help you to fix it

Thank you,
Palani

Please see code above in answer to Brad. Thank you!

Ankur Bawiskar
Tera Patron
Tera Patron

@Eli7 

you can use same script include function to be used from ref qualifier and ajax, but it requires a tweak

this link talks about the same and @Brad Bowman   has shown the approach

Script Function Available to BOTH Client side and Server side Code? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader