Reference Qualifier- Current object

niitnishant
Tera Contributor

Hi Experts,

I have a simple 'client callable' script include which i use to retrun active tickets for the user/caller selected on our 'new call' form. So we have Caller reference field to select a user, and a Ticket number reference field to list his/her active tickets.

I am trying to pass the caller identity i.e. sys_id using the current object, but looks like to the current object is not being passed.

javascript:new myTickets().getTickets(current.caller);

Current is not being considered for some reason, however for testing if i give any hardcoded user sys_id, it does work.

Any help will be appreciated!

Thanks,

Nishant

10 REPLIES 10

Harshit
Tera Contributor

Hi Nishant,



First you are using "Client callable" script include, so you will have to write a client script (using glideajax) onchange of caller to display the list of similar tickets.


"current" will not work on client side scripts.



Regards,


Harshit


Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

It should work. How does your Script Include look like?



hnagory -> This isn't a client script and no need for one either. He is putting the code in the ref qual field on the "ticket" field's dictionary.



//Göran


example:


Field on call:


find_real_file.png



Script include:


find_real_file.png


And no need to check the Client callable field for this use.



//Göran


Hi Goran,



Just want to check, shouldn't we have to use caller_id instead of caller while passing it as parameter to script include?


javascript:new myTickets().getTickets(current.caller_id);



Thanks for you suggestion.