project BLF > class BDraftInstance > method PostSave

Description

Actions to take after writing current instance to the database, and before final commit of the transaction.
Use the field tc_status to test the status of the updated records:
'' = unchanged
'N' = new
'C' = changed
'D' = deleted


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bdraftinstance.p)

<ANCESTOR-CODE>
if oiReturnStatus < 0
then return.

/* ================================================================= */
/* Prepare delete of drafts                                          */
/* ================================================================= */
for each tfcDraftInstance where
         tfcDraftInstance.tc_Status = "D":U and
         tfcDraftInstance.DraftInstance_Id <> tfcDraftInstance.TransactionId:
    create tDraftsToDelete.
    assign tDraftsToDelete.tcFcComponentName = tfcDraftInstance.BusinessClass
           tDraftsToDelete.tiCurrentDraftInstanceId = tfcDraftInstance.DraftInstance_Id.
end.