project QadFinancials > class BMfgCustomer > 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/bmfgcustomer.p)

<ANCESTOR-CODE>

if can-find(first tAutoGenCustList) then 
do:

    <M-9 run StartCacher
       (output vhFcComponent (ohCacher), 
        output viLocalReturnStatus (oiReturnStatus)) in BMfgCustomer>
    if viLocalReturnStatus <> 0 then assign oiReturnStatus = viLocalReturnStatus.
    if viLocalReturnStatus  < 0 then return.

    <M-38 run GetIntegerValueFromSession
       (input  viSessionID (iiSessionId), 
        input  'MfgProMajorVersion' (icDataItemName), 
        output viMfgProMajorVersion (oiValue), 
        output viLocalReturnStatus (oiReturnStatus)) in Cacher>
    if viLocalReturnStatus <> 0 then assign oiReturnStatus = viLocalReturnStatus.
    if viLocalReturnStatus  < 0 then return.

    <M-48 run GetIntegerValueFromSession
       (input  viSessionID (iiSessionId), 
        input  'MfgProMinorVersion' (icDataItemName), 
        output viMfgProMinorVersion (oiValue), 
        output viLocalReturnStatus (oiReturnStatus)) in Cacher>
    if viLocalReturnStatus <> 0 then assign oiReturnStatus = viLocalReturnStatus.
    if viLocalReturnStatus  < 0 then return.

    if viMfgProMajorVersion > 3 /* Meaning eB3 */ or 
       (viMfgProMajorVersion  = 3 /* Meaning eB3 */and 
        viMfgProMinorVersion >= 14 /* Meaning QAD 2014 EE */)
    then do :

        vhInOut = dataset tAutoGenCustList:handle.
    
        <I-41 {bFcStartAndOpenInstance
             &ADD-TO-TRANSACTION   = "False"
             &CLASS                = "PMfgAnalysisCode"}>
             
        <M-61 run AutoGenCustAC
           (input-output vhInOut (bztAutoGenCustAC), 
            output viFcReturnSuper (oiReturnStatus)) in PMfgAnalysisCode>         
    
        <I-66 {bFcCloseAndStopInstance
             &CLASS           = "PMfgAnalysisCode"}>
    end.         
end.