Create and delete records
create | delete
create
To create a record in a specific table by script, specify the corresponding table name in a button after create
.
Example
Result: A new, but empty record in the Customers table.
To fill this new record with data, first store the expression in a variable and then use the variable to access the desired fields.
Initialize the variable
newCustomer
with the expressioncreate Customer
to store the record in the variable.Access the fields of the new record using the dot operator
.
and give the new record a unique Customer number consisting of the letterC
and a UNIX timestamp.
Example
Result: A new record in the Customers table with a unique customer number.
delete
Delete records automatically by specifying which records to delete after delete
.
Insert the following script in a button to delete the current record.
This is useful for linking the deletion process to another action, such as triggering an email before the record is removed.
Example
Result: The current record is deleted.
To delete several records, combine delete
with select
.
Example
Result: All records in the Customers table with the status 4
are deleted.
Last updated