Kbase P10636: How to do a logical delete record using SmartDataObject
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/13/2008 |
|
Status: Unverified
GOAL:
How to do a logical deletetion using SmartDataObject
GOAL:
How to override the deleteRow function
FACT(s) (Environment):
Progress 9.1B
Progress 9.1C
Progress 9.1D
FIX:
The following example deletes the order-line and change the order status without deleting the record.
Override the deleteRow function in the SmartDataObject and add the following code:
DO TRANSACTION ON ERROR UNDO, LEAVE:
FIND FIRST order WHERE ROWID(order) = TO-ROWID(rowObject.RowIdent) EXCLUSIVE-LOCK NO-ERROR.
FOR EACH order-line OF order EXCLUSIVE-LOCK:
DELETE order-line.
END.
/*In this example the record status is saved in the Instructions field*/
ASSIGN Order.Instructions = "RECORD DELETED".
END.
FIND CURRENT order NO-LOCK.
DYNAMIC-FUNCTION('openQuery':U).
/*If the RETURN SUPER is not commented, the physical delete for the record will be done*/
/*RETURN SUPER( INPUT pcRowIdent ).*/