How to fix it
- Navigate to
System Definition > Client Scriptsand open your script record. - Verify the
Tablefield matches exactly where you're testing (e.g., 'incident', 'change_request'). - Check the
Typefield matches when you expect the script to run:
onLoad- runs when form first loadsonChange- runs when specific field value changesonSubmit- runs when form is submitted
- For onChange scripts, verify the
Field namefield contains the exact column name (not display label) that should trigger the script. - To find the correct column name, right-click the field on the form and select
Show - Choice Listor check the table's dictionary. - Check for JavaScript errors by opening browser Developer Tools (F12), going to the
Consoletab, then reload the form or trigger the field change. - If you see red JavaScript errors, fix the syntax issues in your script code and save.
- In your Client Script record, scroll to the
UI Typefield and verify it matches your testing environment:
Desktop- for Platform UI formsMobile / Service Portal- for Service Portal formsAll- for both interfaces
- Verify the
Activecheckbox is checked and save the Client Script record. - Clear your browser cache and refresh the form to test the script again.
Add a simple alert('Script running') or console.log('Script executed') as the first line of your script to quickly verify it's triggering.