4D v16.3DELETE SELECTION |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
DELETE SELECTION
DELETE SELECTION
DELETE SELECTION deletes the current selection of records from aTable. If the current selection is empty, DELETE SELECTION has no effect. After the records are deleted, the current selection is empty. Records that are deleted during a transaction are locked to other users and other processes until the transaction is validated or canceled. Warning: Deleting a selection of records is a permanent operation, and cannot be undone. Unchecking the Records definitively deleted option in the table Inspector allows you to increase the speed of deletions when DELETE SELECTION is used (see Records definitively deleted in the Design Reference manual). The following example displays all the records from the [People] table and allows the user to select which ones to delete. The example has two sections. The first is a method to display the records. The second is an object method for a Delete button. Here is the first method: ALL RECORDS([People]) ` Select all records The following is the object method for the Delete button, which appears in the Footer area of the output form. The object method uses the records the user selected (the UserSet) to delete the selection. Note that if the user did not select any records, DELETE SELECTION has no effect. ` Confirm that the user really wants to delete the records If a locked record is encountered during the execution of DELETE SELECTION, that record is not deleted. Any locked records are put into a set called LockedSet. After DELETE SELECTION has executed, you can test the LockedSet to see if any records were locked. The following loop will execute until all the records have been deleted: Repeat ` Repeat for any locked records
See also
DISPLAY SELECTION
|
PROPERTIES
Product: 4D HISTORY
Created: < 4D v6 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||