iHow to pass multiple parameters to script include function using advanced reference qualifier

Alon Grod
Tera Expert

Hi,

How can I pass multiple parameters to script include function using advanced ref qualifer?

When Im only sending one parameters Im getting a log, but when I send multiple Im not getting any log.

javascript: newSiteOffering().isUnique(current.service_offering,current.caller_id.location,current.business_service);

 

var SiteOffering = Class.create();

SiteOffering.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    isUnique: function(service_offering,location,business_service){
		
		var serv = service_offering;
                var loc = location;
                var bs = business_serivce
		gs.log('Alonso: ' + serv + ' ' + loc + ' ' + bs);

    },
    type: 'SiteOffering'
});

 

 

 

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @Alon Grod,

 

You are passing the parameter in right way.

javascript: newSiteOffering().isUnique(current.service_offering, current.caller_id.location, current.business_service);

 

Try by modifying log statement as:

gs.log("service_offering: " + service_offering + " location: " + location + " business_service: " + business_service);

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

View solution in original post

2 REPLIES 2

Arun_S1
Tera Guru
Tera Guru

@Alon Grod 

1. No changes required in your Advanced Reference Qualifier.

2. Create a new Script Include with the name "SiteOffering" without enabling "client callable" checkbox and add the below script

 

var SiteOffering = Class.create();
SiteOffering.prototype = {
    initialize: function() {},
    isUnique: function(service_offering,location,business_service) {
               var serv = service_offering;
                var loc = location;
                var bs = business_serivce
		gs.log('Alonso: ' + serv + ' ' + loc + ' ' + bs);
                return '';
    },

    type: 'SiteOffering'
};

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

Sagar Pagar
Tera Patron

Hi @Alon Grod,

 

You are passing the parameter in right way.

javascript: newSiteOffering().isUnique(current.service_offering, current.caller_id.location, current.business_service);

 

Try by modifying log statement as:

gs.log("service_offering: " + service_offering + " location: " + location + " business_service: " + business_service);

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow