Script
Overview
To enable UI operations that cannot be achieved with standard functions via Ajax POST requests, you can set JavaScript that can be applied to each site.
Below is how to add it and a list of currently available APIs.
How To Add A Script
(This operation requires "Site Administration Permission.")
1. Open the target table.
1. Click "Manage Table" from the "Manage" menu.
1. Open the "Script" tab.
1. Click the "Create New" button.
1. Enter/set the column in the table below.
1. Click the "Add" button.
1. Click the "Update" button at the bottom of the screen.
| Column name | Description | Setting method |
| Title | Script title | Enter any title |
| Script | Script content | Enter any script |
| Output to | Select the output screen | Set with checkboxes |
Notes on Script Permissions
Scripts are executed with the permissions of the logged-in user. If the permissions of a specific user or a system administrator are required for execution, you need to specify that user's API key.
List Of Script Functions
| No | Function name | Description |
| 1 | $p.set | This function changes the value on the screen and stores it in $p.data at the same time. |
Site Message Script (Message.js)
| No | Function name | Description |
| 1 | $p.clearMessage | This function deletes the message displayed at the bottom of the screen. |
| 2 | $p.setMessage | This function displays a message at the bottom of the screen. |
Scripts for command operations and user/department/group operations (_Api.js)
| No | Function name | Description |
| 1 | $p.apiUrl | A function that retrieves the URL value of the API request. |
| 2 | $p.apiGet | A function that retrieves values. |
| 3 | $p.apiCreate | A function that creates new records. |
| 4 | $p.apiUpdate | A function that updates records. |
| 5 | $p.apiDelete | A function that deletes sites and records. |
| 6 | $p.apiBulkDelete | A function that deletes sites and records in bulk. |
| 7 | $p.apiUsesGet | A function to retrieve user information. |
| 8 | $p.apiUsesUpdate | A function to update user information. |
| 9 | $p.apiUsesDelete | A function to delete user information. |
| 10 | $p.apiDeptsUrl | A function to retrieve the URL for executing the API for any department on the site. |
| 11 | $p.apiDeptsGet | A function to retrieve department information. |
| 12 | $p.apiGroupsUrl | A function to retrieve the URL for executing the API for any group on the site. |
| 13 | $p.apiGroupsGet | A function to retrieve group information. |
| 14 | $p.apiSendMailUrl | This function allows you to obtain the URL for sending emails via API. |
| 15 | $p.apiSendMail | This function sends emails. |
Value Setting/Update/Get/Delete Scripts (_Elements.js)
| No | Function name | Description |
| 1 | $p.id | A function to get the ID value of a record. |
| 2 | $p.siteId | A function to get the ID value of a site. |
| 3 | $p.loginId | A function to get the login ID. |
| 4 | $p.userId | A function to get the user ID of the logged-in user. |
| 5 | $p.userName | A function to get the name of the logged-in user. |
| 6 | $p.getColumnName | A function to get the column name (database column name) of the target column. |
| 7 | $p.getControl | A function to get elements from the target column name. |
| 8 | $p.getField | A function to get the field from the target column name. |
| 9 | $p.getGridRow | A function to get the tr tag element of the record on the "List Screen". |
| 10 | $p.getGridCell | A function to get the td tag element on the "List Screen". |
| 11 | $p.getGridColumnIndex | A function to get the column number of the record's name displayed data on the "List Screen". |
| 12 | $p.on | A function that can execute any process when each event occurs. |
Event Firing Script (_Event.js)