We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Issue with onLoad Client Script Alert in Australia Version

gavarlamoun
Mega Contributor

Hi everyone,

I am facing an issue in the latest Australia version of ServiceNow. While writing a Client Script with the "onLoad" type, I am not getting the alert message in the browser.

Could anyone please guide me on how to resolve this issue?

 

Thank you.

 

3 REPLIES 3

Priyanka64
Tera Contributor

Hello @gavarlamoun ,

 

Here are a few things you can check to resolve it:

 

1. Verify the Client Script configuration

  • UI Type = `All` or correct UI experience
  • No condition preventing execution

2. Check if you are using Workspace / Next Experience
In Agent Workspace or Next Experience, traditional alert() behavior can be inconsistent or blocked. Try using: g_form.addInfoMessage("Test message"); instead of alert().

3. Open Browser Developer Console
Press F12 - Console tab and check for JavaScript errors. Another script error may be stopping execution.

4. Clear cache

5. Check Isolate Script setting - If “Isolate script” is enabled, try disabling it temporarily for testing.

 

If this helps, kindly mark the answer as helpful/correct.

 

Thanks,

Priyanka

 

Ankur Bawiskar
Tera Patron

@gavarlamoun 

you didn't share the client script config screenshots

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Srikanth_9
Mega Sage

Hi @gavarlamoun,

 

Please share the screenshot of the client script, so that will help you.

 

If the provided solution is useful/working, please Accept as Solution and hit the Helpful. 
 
Thanks & Regards,
Srikanth Akula.