4D v16.3

SAVE RECORD

Home

 
4D v16.3
SAVE RECORD

SAVE RECORD 


 

SAVE RECORD {( aTable )} 
Parameter Type   Description
aTable  Table in Table for which to save the current record, or Default table, if omitted

SAVE RECORD saves the current record of aTable 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.

If you call the SAVE RECORD command when no field has been modified in the record, the command does nothing (the trigger is not called).

Here are some cases where SAVE RECORD is required:

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.

Note: Saving a record that contains edited object field(s) usually requires that you notify explicitely 4D before calling SAVE RECORD. For more information, please refer to the Saving Object fields section.

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

 
PROPERTIES 

Product: 4D
Theme: Records
Number: 53

This command can be run in preemptive processes

 
HISTORY 

Created: < 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)