How to Call Client callable Script Include from public UI page?

Shivling
Tera Contributor

Steps 1: Created below UI page and Made Public by creating a record in the sys_public table.

Shivling_0-1716563213257.png

 

 

sys_public record:

Shivling_1-1716561675279.png

Step 2: Created a client callable script include:

Shivling_5-1716562112212.png

 

Step 3: Created UI Script:

Shivling_4-1716562026044.png

Here line no 11 alert is popping up.

 

Based on the steps outlined above: Upon reaching the UI page below, the expectation is for an alert to pop up, and for the info message from the client-callable script to be logged into the logs table. However, neither of these actions are occurring. It appears that the script include is not being triggered by the GlideAjax call.

(https://xxxxx.service-now.com/ui_page_name.do?sysparm_instanceid=4d3f1c2f.

I'm not sure where I'm going wrong, so any input or suggestions would be much appreciated.

 

 

1 REPLY 1

Bert_c1
Kilo Patron

the 'alert()' function is client side API and wont work in a script include (server side). And your script include class is 'CustomtestClientSI' where in the UI script you have 'CustomDocuSignClientSI'. change one or the other to match.  I suggest you review OOB UI Scripts that use GlideAjax to see working examples. the UI Script named 'IncidentalsCalculator' is a good example.