How to call script include in UI page?

raajesh
ServiceNow Employee
ServiceNow Employee

Can anyone help that how to call script include in UI page. I am trying to cleat cache in scoped application while loading UI page.

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

Hi @raajesh 

 

If you want to call Script Include in Client Script of UI Page, you have to use GlideAjax function. Please refer below link for it:

https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/script/ajax/topic/p_AJAX...

 

But if you want to call Script Include in 'Processing Script' which is server side script, you can try below syntax:

 

var result = new ScriptIncludeName().functionName(parameter);

 

For example if Script Include name is HelloABC and function is getAbcDetails(user_id) where user_id is parameter passed, you can use below code:

 

var rsult = new HelloABC().getAbcDetails(user_id);

- where rsult will staore the value returned from the function.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi,

I am getting error of "GlideAjax is not defined" while using new GlideAjax in UI page client script. I am trying to call function in client script which have glideajax script from the onload event of body tag in UI page.

 

Is there a way or any method to use GlideAjax in UI page?