Call client callable script include from Business Rule /Background Script

Abc 26
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
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

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

View solution in original post

6 REPLIES 6

Musab Rasheed
Tera Sage
Tera Sage

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

Please hit like and mark my response as correct if that helps
Regards,
Musab

Namrata Ghorpad
Mega Sage
Mega Sage

Ankur Bawiskar
Tera Patron
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

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

@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

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