Delete with confirmation

Command groupFlag affectedReversibleExecute on clientPlatform(s)
Changing dataYESNONOAll

Syntax

Delete with confirmation
 
message

Description

This command displays a message asking the user to confirm or cancel the deletion and, if confirmation is granted, deletes the current record in the main file. An error is reported if there is no main file.

If a message is not specified, Omnis uses a default message. The message can contain square-bracket notation which is evaluated when the command is executed. If the current record is deleted, the flag is set, otherwise it is cleared. If the Do not wait for semaphores option is on, the flag is cleared if the record is locked.

Example

# This example allows selected records in the main file to be deleted:

Set main file
 
fAccounts

Set search as calculation
 
fAccounts
.
Balance
<0

Find first
 
on 
fAccounts
.
Code
 (
Use search
)

While flag true
  
Delete with confirmation
 
Delete [
fAccounts
.
Surname
]'s record?

  
Next
 (
Use search
)

End While