INSERT Function (RecordRef)

Inserts a record into a table.


[Ok :=] RecordRef.INSERT([RunTrigger])

Parameters

RecordRef

Type: RecordRef

The recordref that refers to the record that you want to insert.

RunTrigger

Type: Boolean

Specifies whether to run the C/AL code in the OnInsert Trigger.

If this parameter is true, the code on the OnInsert trigger will be executed.

If this parameter is false, the code on the OnInsert trigger will not be exectued.

Type: Boolean

true if the record was inserted; otherwise, false.

If you omit this optional return value and if the record cannot be inserted, a run-time error occurs. If you include the return value, you must handle any errors.

Records are uniquely identified by the values in primary key fields. The C/SIDE Database Management System (DBMS) checks the primary key for the table before it inserts a new record.

If the table contains an auto-increment field, the auto-increment feature is used if the record contains a zero value in that field. The auto-increment feature enters the new value into the field as part of the insert.

If the auto-increment field contains a non-zero value, that value is inserted into the table and the auto-increment feature is not used. If the value in the auto-increment field is greater than the last auto-increment value in the table, the next auto-increment value that is entered into the table will be greater than the value in the field that you just inserted. If the value in the auto-increment field already exists in the table, a run-time error occurs.

This function works the same as the INSERT Function (Record).

Community Additions

ADD
Show: