Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Unable to call an UI script from client script within scoped application

priyannka
Tera Contributor

Hello,

I am working on a scoped application and i was trying to call an UI script function from a client script in the same scope but i am not able to do it.Please find the script which i am using below -

UI script- 
Name - clientUtil

var x_roho_c2r = x_roho_c2r || {};
x_roho_c2r.clientUtil = (function() {
"use strict";
function giveAlert(){
alert('alert from cilentUtil...!!!!');
}
return {
type: "clientUtil"
};
})();

 

Client script -

function onLoad() {
//Type appropriate comment here, and begin script below
alert('onLoad Client script..!!!');
ScriptLoader.getScripts('x_roho_c2r.clientUtil.giveAlert()', function(){
x_roho_c2r.clientUtil.giveAlert();
 alert('testing loop second');

 });

Any help please?

5 REPLIES 5

Gaurav Shirsat
Mega Sage

Hi Vaishnavi

Try This by using the Script Loader:-

ScriptLoader.getScripts(['scripts/get_wsdl_url.js'], function() {  });

 

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat