OnLoad Client Script Not Executing on a Specific Table

Saraswathi Devi
Tera Contributor

Hi Everyone,

 

I am experiencing an issue where an onLoad client script is not executing on a particular table in my ServiceNow instance. I've followed various troubleshooting steps, but the script still does not run. 

 

Steps Taken:

  1. Script Activation:

    • The client script is active (active checkbox is checked).
  2. Table and View Configuration:

    • The client script is set to the correct table and view.
  3. Script Syntax and Errors:

    • No syntax errors found in the script. Added logging and alerts for debugging.
  4. Script Scope and Permissions:

    • The script is in the correct application scope and has necessary permissions.
  5. Client Script Type:

    • The script type is set to onLoad
  6. Form and UI Policy Conflicts:

    • Checked for other client scripts (OnChange is working fine on the same table) and UI policies that might conflict, but found none.
9 REPLIES 9

Sandeep Rajput
Tera Patron
Tera Patron

@Saraswathi Devi Thanks a lot for sharing the steps you already verified. Now please verify the following.

1. UI Type: Please check if the UI Type is set to ALL or it is set to a value which is aligned with the platform on which you are testing

2. Script: Please see if there is any incorrect syntax within your client script which is causing your script to crash.

3. return statement: Please check if there is any return statement at the beginning of the script which is not letting the rest of the code to execute.

Saraswathi Devi
Tera Contributor

Hi @Sandeep Rajput ,

 

I have set the UI type to All and I have tried only the info message line. Onchange client script is working fine on this table.

SaraswathiDevi_0-1720588308274.png

And the same script is working on another Table.

@Saraswathi Devi This looks like a caching issue to me now. Please test this form again in an incognito window and see if the message appears on the form.

@Saraswathi Devi I have sent you a message on community inbox. Please check.