Quick jump |
Events are fragments of PHP or JavaScript code that are executed automatically when certain conditions are met, for instance: a record was added to the database, or the user opened the List page. You can use sample event code snippets or write the code on your own.
Here are a few examples of events:
•send an email containing the data from a new record or showing changes to an existing record;
•save new data in another table;
•check if a specific record exists;
•limit the number of records a user can add.
There are two types of events: Global and Table events. Global events can be used with any table/view. Table events work with a specific table/view.
Event Editor toolbar description
Button |
Description |
|
Allows adding one of the predefined actions. |
|
Erases the event code. |
|
Reverses the last operation. |
|
Reverses the last "Undo" operation. |
|
Syntax error indicator. Will display a check mark if the code is correct and stop sign otherwise. |
|
Opens the Search and Replace in the current event dialog. |
|
Opens the Find All dialog. Searches and replaces the code across all events. |
|
Opens AI assistant panel. |
1. Go to the Events screen.
2. Select an event from the tree in the left pane. Events with the code will be shown in bold. To filter the events by name, use the text field above the tree in the left pane.
Each event has a collapsible hint with the event description, syntax, and a list of parameters. To hide the hint, click the 'Description' link.

Note: you can change the font size on the Event Editor and Style Editor screens. Hold CTRL and scroll the mouse wheel to do so.
3. Add the code or click the
button to open the predefined actions popup.
To learn more, see these articles:
•Sample events - examples of commonly used events with code snippets.
•Common parameters you can use in the events.
4. Choose one of the predefined actions to add a code snippet to the event.

5. Modify the code snippet replacing the sample values with the actual ones.

Note: you can add more than one predefined action to an event.
To edit the event, select an event and modify the code. To delete the event, select an event and click the
button.
Intellisense is a convenient way to access the descriptions and variables of the functions. The Event Editor recognizes the functions and variables and shows the function description or the list of available variables to choose from in a popup.
Here are a few examples:
Database API

PHP functions

JavaScript API functions

Field names

You can find a custom_function.js file in the event tree in the left pane. This file is loaded on each page in the generated application.
Custom_function.js is best suited for utility functions. For example, you can add an OrderTotal calculation to this file to Show order total on the Edit page as the details table is updated.
Here is how the cuctom_function.js window looks like on the Events screen:

See also: