This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
DELETE RECORD
|
DELETE RECORD {( aTable )} | ||||||||
Parameter | Type | Description | ||||||
aTable | Table |
![]() |
Table where the current record will be deleted, or Default table, if omitted | |||||
DELETE RECORD deletes the current record of aTable in the process. If there is no current record for aTable in the process, DELETE RECORD has no effect. In a form, you can create a Delete Record button instead of using this command.
Notes:
Deleting records is a permanent operation and cannot be undone (except when it is executed during a transaction, see Using Transactions).
If a record is deleted, the record number will be reused when new records are created. Do not use the record number as the record identifier if you will ever delete records from the database.
The following example deletes an employee record. The code asks the user what employee to delete, searches for the employee’s record, and then deletes it:
vFind:=Request("Employee ID to delete:") ` Get an employee ID
If(OK=1)
QUERY([Employee];[Employee]ID =vFind) ` Find the employee
DELETE RECORD([Employee]) ` Delete the employee
End if
Product: 4D
Theme: Records
Number:
58
Modified: 4D 2004
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)