Delete Operations with Data Entry Objects
When Data Entry Objects (DEOs) are connected to a Data Dictionary Object (DDO), the entire delete process is automatic and controlled by the user. The user will find a record and then perform some action (button click, keystroke, etc.) to request the delete. When this occurs, a message is sent to the DEO, usually Request_Delete, to start the delete. The DEO handles the following tasks:
- Checks if a delete is needed and allowed
- Verifies with the user that they want to perform the delete
- Asks its DDO to perform the delete (Request_Delete)
- Updates DEOs with new saved changes
- Optionally clears the entry forms
Below is an example of a simplified DEO Request_Delete procedure. These are the types of methods and functionality built directly into DEOs.
// The DEO Delete Process
Procedure Request_Delete
Handle hoDDO
Boolean bCanDelete bError
Get Server to hoDDO
Get Can_Delete of hoDDO to bCanDelete
If (not(bCanDelete)) Procedure_Return // deletes are not allowed
Get Verify_Delete to bError // ask user to confirm delete
If bError Procedure_Return // user decided not to delete
Send Request_Delete of hoDDO
Move (Err) to bError // Err set if delete failed
If (not(bError)) Begin
Send Request_Clear // clear DDOs after the delete
End
End_Procedure