Call client callable script include from Business Rule /Background Script

mehtaaaksha
Tera Expert

Hello Experts,

I want to use the client callable script include from business rule /Background script. Please help.

Sample Client callable script Include script

getCallerLang: function(){
    var caller_id = this.getParameter('sysparm_caller_id');
}

Please help to fetch the output through background script.

Note : function does not have any parameter in Client callable script Include script.

@Ankur Bawiskar 

Regards
 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

Hi,

yes that's possible

Same function can be called from ajax or server side like this

getCallerLang: function(caller){

	var caller_id = JSUtil.nil(caller) ? this.getParameter('sysparm_caller_id') : caller;

}

regards
Ankur

View solution in original post

6 REPLIES 6

Musab Rasheed
Kilo Patron

Hello,

Go through below links

https://community.servicenow.com/community?id=community_question&sys_id=e15f51d91b2800d4d01143f6fe4bcb3f

https://community.servicenow.com/community?id=community_question&sys_id=5041fe0ddbb867448e7c2926ca96198e

https://community.servicenow.com/community?id=community_question&sys_id=4510f576dbabe7c0107d5583ca961910

To learn more about script include refer this

https://www.basicoservicenowlearning.in/2019/12/script-include-servicenow.html

Regards

Not applicable

Ankur Bawiskar
Tera Patron

Hi,

yes that's possible

Same function can be called from ajax or server side like this

getCallerLang: function(caller){

	var caller_id = JSUtil.nil(caller) ? this.getParameter('sysparm_caller_id') : caller;

}

regards
Ankur

@Abc 26 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur