Server Script
Overview¶
Using "Server Script" allows you to execute JavaScript on the server side, enabling conditional branching, calculations, string processing, record manipulation, notifications via email or chat, dynamic access control, and more. The JavaScript execution engine used is Microsoft's ClearScript.
This category contains the following.
- Basics
- context
- logs
- siteSettings
- view
- grid
- columns
- elements
- utilities
- model
- saved
- items
- apiModel
- users
- user
- depts
- dept
- group
- groups
- notifications
- notification
- hidden
- httpClient
- $ps.CSV
- $ps.file
- $ps.JSON
- extendedSql
- $p.JSON
- responses.Reload
- Sample of Exporting a File with a Server Script
- Sample of Importing a File with a Server Script
Icons in the Navigation
In the navigation on the left, the type of each page is indicated by an icon.
| Icon | Type | Description |
|---|---|---|
| Object | An object in this category | |
| Method | A method of an object | |
| Property | A property of an object |
Pages whose type could not be determined do not have an icon.
Limitations¶
- External scripts cannot be loaded.
- Local resources such as local disks cannot be accessed.
- DateTime values in server scripts are converted to UTC.
Notes on Server Script Permissions¶
- Server scripts are executed with the permissions of the logged-in user. If execution requires the permissions of a specific user or system administrator, you must specify that user's Developer's Guide: API: Create an API Key.
Difference Between Scripts and Server Scripts¶
"Developer's Guide: Script" allows you to manipulate on-screen data by writing JavaScript that runs in the browser, but it cannot process data during "Developer's Guide: API" data updates or "Table Function: Importing Records". With "Server Script", JavaScript input/output can be performed on the server's record model, enabling data processing even during "Developer's Guide: API" and "Table Function: Importing Records".
Modularization Features¶
"Server Script" provides the "Share Code" feature for modularizing common code, and the include feature of "Developer's Guide: Extensions: Extended Server Scripts".
Debug¶
You can Debug "Server Script" using Visual Studio Code.
Operation Procedure¶
Please refer to "Server Script".