Calling Script Includes from Service Portal widget

davilu
Mega Sage

Hi Everyone,

I've read through several community postings about this, but couldn't find a concrete answer.   Is it possible to call a script includes from a Service Portal widget?   Our team has a server call that we would like to reuse in multiple widgets, so thought we would leverage a Script Includes and just call upon that script in all of the widgets that would need it.   What is the correct syntax for achieving this?

1 ACCEPTED SOLUTION

ark6
Mega Guru

Yes, you could call a script include in the widget.



You need to include your code in the server part of the widget.



the syntax could be like this



var a=new include_name().include_function(<parameters if you want to pass>);



now you could use the value of the variable and populate the data object and use it in the html code   .


View solution in original post

1 REPLY 1

ark6
Mega Guru

Yes, you could call a script include in the widget.



You need to include your code in the server part of the widget.



the syntax could be like this



var a=new include_name().include_function(<parameters if you want to pass>);



now you could use the value of the variable and populate the data object and use it in the html code   .