DELETE Function (RecordRef)
Deletes a record in a C/SIDE table.
[Ok :=] RecordRef.DELETE([RunTrigger])
Parameters
- RecordRef
-
Type: RecordRef
The recordref that refers to the record that you want to delete.
- RunTrigger
-
Type: Boolean
Specifies whether the code in the OnDelete trigger will be executed. If this parameter is true, the code will be executed. If this parameter is false (default), the code will not be executed.
This parameter is optional.
Type: Boolean
true if the record was deleted. false if the record was not deleted because it could not be found in the table, because the user did not have the correct permissions, or because the C/AL code terminated.
If the record does not exist and you do not include a return value, a run-time error will occur.
The current key and any filters on the record have no effect on this operation. The record to delete is identified by the values in its primary key.
In a multi-user environment, another application can delete the record from the table after you read the record and before you try to delete it. The Database Management System automatically detects such a situation, which causes the RecordRef.DELETE function to fail with a run-time error.
To prevent this situation, you can lock the table while you are using it with the LOCKTABLE Function (RecordRef).