Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
The system events allow you to create tasks for server-side script execution, or notification sending at a specified point in time. These are the most common use cases of system events. You can also use one event register for the needs listed above.
Tip |
---|
Role required: admin. |
To use the system events in your tasks, you need to create complete the following steps:
- Create an event register record.
Then, you can handle it in one of the following ways:
- Define a server script for a system event by creating a record in the Event Script Actions (sys_event_script_action) table.
- Define a notification rule to send notifications.
- You can combine the options listed above so that the event register record triggers actions and sends notifications at the same time.
Event structure
Create an event
To create an event, use the server-side API methods ss.eventQueueor ss.eventQueueScheduled. Create an event as described in the referenced articles. As a result, new records in the Event (sys_event) table will be created.
Note |
---|
You cannot create, edit, or delete records in the Events (sys_event) table manually. Only users with the admin role can read them. |
To read event records, navigate to System Events → Events.
Anchor | ||||
---|---|---|---|---|
|
Field | Description | ||
---|---|---|---|
Name | The name of the record called from the Event Register (sys_event_register) table. | ||
Instance | The ID of the record object. When creating an event with the ss.eventQueue or ss.eventQueueScheduled method, pass on the Record object. The object ID will be saved in this field. Call this value in the Event Script Action (sys_event_script_action) script body:
| ||
Table | A reference to the record table that was passed when the event was created. This field is populated automatically. | ||
Process started at | The date and time when the system event execution started. As for the scheduled events, this field is populated with the value passed by the parameter of the ss.eventQueueScheduled method. The date and time of the Event (sys_event) script execution. | ||
Process finished on | The date and time when the system event execution finished. | ||
Param1-5 | The string parameters that can be passed to the specified Event (sys_event)record via the SimpleOne server-side API (ss.eventQueue and ss.eventQueueScheduled methods).
| ||
State | The event state:
| ||
Processing duration, ms | The duration of the system event processing in milliseconds. | ||
User | This field is populated with the system user (which can also be displayed as 100000000000000000 on the forms). The system executes the script on behalf of this user. |
Related lists are bound with the event record and contain the following records:
- The list of all related event register records from the Event Register (sys_event_register) table.
- The list of all the scripts from the Event Script Action (sys_event_script_action) table that have references to the current record.
Anchor | ||||
---|---|---|---|---|
|
To create an event register, complete the following steps:
Navigate to System Events → Event Registers.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Event Register form fields
Field | Mandatory | Description | ||
---|---|---|---|---|
Name | Y | Specify the name of the event register. The Event (sys_event) record of this register contains this value in its Name field.
| ||
Table | Y | Specify the table that contains records related to the events. To trigger email sending with this record, ensure that the value in the Table field in the Notification Rule record is the same as in this event register record. | ||
Description | N | Add a description for the event register record. | ||
Disable script logging | N | Select the checkbox to disable script execution logging to the Script Logs (sys_log_script) table when the related event begins. |
The Related Lists area bound with the event register record contains the following records:
- A list of all the scripts from the Event Script Action (sys_event_script_action) table that have references to the current record.
- A list of all Notification Rules triggered by the record of the current event register.
Anchor | ||||
---|---|---|---|---|
|
To create an event register, complete the following steps:
Navigate to System Events → Event Scripts.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Field | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | Specify the name of the event script action. | ||||||||||||||||||||||
Event Register Record | The reference to the record in the Event Register (sys_event_register) table. | ||||||||||||||||||||||
Active | Select this checkbox to activate the script. | ||||||||||||||||||||||
Script | Specify the script that is executed when the event occurs.
You can also update the parameters (Param1-5) of the event object with the Event Script Action.
|
Table of Contents | ||||
---|---|---|---|---|
|
...