How to call UI Scripts from Client Scripts

Mi4
Tera Expert

Hi.,

I want to call a global UI Script from a scoped application.

But I keep getting the following error.

What's wrong?

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var segmenter = new global.TinySegmenter(); }

 

Thanks in advance,

1 ACCEPTED SOLUTION

Megha Padale
Giga Guru

Hi,

You can use ScriptLoader 

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

https://developer.servicenow.com/dev.do#!/reference/api/madrid/client/c_ScriptLoaderAPI

You access the ScriptLoader methods by using the global object ScriptLoader.
 
 

If my answer helped you in any way, mark answer as helpful and correct.

Thanks and regards,

Megha.

View solution in original post

14 REPLIES 14

Santosh_Ksagar
Mega Sage
Mega Sage

Hi,

can you share your ui script code?

Thanks
Santosh

Hi,

Thank you for your comment.

UI Script works on Global.

 

Regards,

Ishita Shrivast
Kilo Guru

Hey there, can you confirm if the Global field is checked?

Regards,

Ishita.

Hi,

Thank you for youd advice.

The checkbox is false because I set the type to 'ALL'.

 

Regards,