project QadFinancials > class BDDocument > 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/bddocument.p)

<ANCESTOR-CODE>

for each tDDocument where 
         tDDocument.tc_Status        = "N":U and
         tDDocument.DDocumentNumber <> 0     and
         tDDocument.DDocumentNumber <> ?:
    assign vhFcComponent = ?.

    <M-1 run CommitNumber
       (input  tDDocument.Company_ID (iiCompanyID), 
        input  tDDocument.DDocumentYear (iiNumbrYear), 
        input  'D':U + tDDocument.DDocumentType (icNumbrType), 
        input  tDDocument.DDocumentNumber (iiNumbr), 
        input  viFcCurrentInstanceId (iiInstanceId), 
        input  vcFcComponentName (icClassName), 
        output viFcReturnSuper (oiReturnStatus)) in BNumber>

    if viFcReturnSuper < 0 or
       oiReturnStatus  = 0
    then assign oiReturnStatus = viFcReturnSuper.

    if oiReturnStatus < 0
    then return.
end.