DELETE RECORD

4D - Documentation   Français   English   German   4th Dimension 2003, Command Theme List   4th Dimension 2003, Command Alphabetical List   4th Dimension 2003, Constant Theme List   Back   Previous   Next

version 3


DELETE RECORD {(table)}

ParameterTypeDescription
tableTableTable for which to delete the current record, or
Default table, if omitted

Description

DELETE RECORD deletes the current record of table in the process. If there is no current record for table in the process, DELETE RECORD has no effect. In a form, you can create a Delete Record button instead of using this command. After the record is deleted, the current selection for table is empty.

Deleting records is a permanent operation and cannot be undone.

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.

Example

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

See Also

Locked, Triggers.


4D - Documentation   Français   English   German   4th Dimension 2003, Command Theme List   4th Dimension 2003, Command Alphabetical List   4th Dimension 2003, Constant Theme List   Back   Previous   Next