How to call Script include from UI policy?

Ksnow
Tera Contributor

Hello All,

Can anyone let me know how to call script include from UI policy?

Business services will be selected on incident form, business services have parents if suppose(Test-1 is parent for Test-2, Test-2 is parent for Test-3 n so on) and for a few business services there is one checkbox which is checked in, checkbox name is SLA(it has defined time duration values), for example test-2 has checkbox and it's checked in. When i select Test-3(which doesn't have checkbox checked in) it has to take test-2 values and those values will be displayed in the section tab called SLAtime on the incident.

My requirement here is that section should be visible whenever the Business services have SLA checkbox checked in and their parents as well, not when the service doesn't have SLA checked in. 

I could do this by UI policy but in scriptInclude named as SLAparent has some script which will check if parent has SLA button checked in or not, If current service has checked in it will take the value else it will check parent services and take parent SLA values.

I tried to hide section from client script along with the above script include, but it's not working.

So I wanted to call script include from UI policy, is that possible to fulfil my requirement?

Please assist, appreciated your time and responses.

Thanks,

Ksnow

2 REPLIES 2

Allen Andreas
Administrator
Administrator

Hi,

You should be able to call your script include in the script section of the UI Policy, just check the advanced box. UI Policy script section is like client script.

https://docs.servicenow.com/bundle/orlando-application-development/page/script/ajax/topic/p_AJAX.htm...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Pranav Bhagat
Kilo Sage

You can use glideajax.

The GlideAjax class allows the execution of server-side code from the client. GlideAjax calls pass parameters to the script includes, and, using naming conventions, allows the use of these parameters.

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Pranav