version 3
SAVE RECORD {(table)}
Parameter | Type | Description | |
table | Table | Table for which to save the current record, or | |
Default table, if omitted |
Description
SAVE RECORD saves the current record of table in the current process. If there is no current record, then SAVE RECORD is ignored.
You use SAVE RECORD to save a record that you created or modified with code. A record that has been modified and validated by the user in a form does not need to be saved with SAVE RECORD. A record that has been modified by the user in a form, but has been canceled, can still be saved with SAVE RECORD.
Here are some cases where SAVE RECORD is required:
To save a new record created with CREATE RECORD or DUPLICATE RECORD
To save data from RECEIVE RECORD
To save a record modified by a method
To save a record that contains new or modified subrecord data following an ADD SUBRECORD, CREATE SUBRECORD, or MODIFY SUBRECORD command
During data entry to save the displayed record before using a command that changes the current record
During data entry to save the current record
You should not execute a SAVE RECORD during the On Validate event for a form that has been accepted. If you do, the record will be saved twice.
Example
The following example is part of a method that reads records from a document. The code segment receives a record, and then, if it is received properly, saves it:
RECEIVE RECORD ([Customers]) ` Receive record from disk If (OK= 1) ` If the record is received properly SAVE RECORD ([Customers]) ` save it End if
See Also
CREATE RECORD, Locked, Triggers.