All scripts, regardless of the script type, have two parts:
- Configuration: specifies when to execute the script logic
- Script: contains the script logic specifying what to do when the configuration criteria are met
Although the configuration is different for every script type, the Script Editor is the same for all scripts. The Script Editor features include:
Real-time Syntax Checking
The Script Editor indicates JavaScript syntax errors by placing warning (
) and error (
) indicators next to the line numbers. Hover over an indicator for more information. Depending on the error, the root cause of the syntax issue might be on a line above the line with the indicator.
Real-time syntax checking looks for errors in JavaScript syntax only. For example, the syntax checker finds missing semicolons at the end of lines, incomplete arguments in for loops, and missing characters such as ", ', [ and }. The syntax checker cannot find typos in variable names, functions, or method names. The syntax checker cannot determine if a script works as expected.
Toolbar
The Script Editor toolbar contains buttons (from left to right) for:
-
Script Editor help
-
Enable/Disable syntax highlighting
-
Toggle comments on/off
-
Format code (apply indenting)
-
Replace a string
-
Replace all occurrences of a string
-
Search for a string
-
Find next occurrence of a string
-
Find previous occurrence of a string
-
Make the Script Editor full screen
-
Get a list of keyboard shortcuts
-
Save the record
-
Toggle real-time syntax checking on/off
-
Open the server-side JavaScript debugger (not available for client-side scripts)
Syntax Highlighting
The Script Editor applies color coding to scripts for readability.
- Green: comments
- Magenta: JavaScript objects
- Blue: strings, reserved words
The color coding palette is not user configurable.
Show Documentation, Definitions, and Data
Right-click bold text in the Script Editor to view:
- API documentation
- Record definitions
- List of records
- Other scripts for the same element