Kbase 21597: ADM2 - Where to add logic to cancel a delete operation
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  14/12/2001 |
|
SUMMARY:
The following example code illustrates where and how to add logic
to a delete operation, allowing a user to cancel the delete if they
so choose. This can be accomplished by creating a deleteRow override function in the SDO.
SOLUTION:
Edit the master of the SDO and create a new local override function deleteRow. Implement code similar to the following.
RETURNS LOGICAL
( INPUT pcRowIdent AS CHARACTER) :
/*------------------------------------------------------------------------------
Purpose: Super Override
Notes:
------------------------------------------------------------------------------*/
/* Code placed here will execute PRIOR to standard behavior. */
DEF VARIABLE ifDelete AS LOGICAL.
MESSAGE "Do you really want to delete this record?"
VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE ifDelete.
IF ifDelete THEN
RETURN SUPER( INPUT pcRowIdent ).
END FUNCTION.
/* This allows the user to answer yes or no to a delete operation.
If yes, the delete gets executed, if no, nothing should happen */
References to Written Documentation:
ADM 2 Guide.