Create and delete records
create | delete
To create a record in a specific table by script, specify the corresponding table name in a button after
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.
- 1.Initialize the variable
newCustomerwith the expression
create Customerto store the record in the variable.
- 2.Access the fields of the new record using the dot operator
.and give the new record a unique Customer number consisting of the letter
Cand a UNIX timestamp.
let newCustomer := (create Customers);
newCustomer.('Customer number' := "C" + number(now()))
Result: A new record in the Customers table with a unique customer number.
Delete records automatically by specifying which records to delete after
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.
Result: The current record is deleted.
To delete several records, combine
delete select Customers where Status = 4
Result: All records in the Customers table with the status