project QadFinancials > class BCOAMaskCC > method SetNewStatus

Description

Change the status of all current class temp-table records to 'N'.
Useful for making a copy of a database instance.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bcoamaskcc.p)

<ANCESTOR-CODE>

if oiReturnStatus < 0 then return.

assign viLocalReturn = oiReturnStatus
       oiReturnStatus      = -98.

MAIN_BLOCK:
do on error undo, return:
    /* ============================================================================ *
     * This method is executed also for COPY activity. But COA Mask can contain     *
     * ranges that belongs to other domains(shared sets). Therefore only those      *
     * ranges that belongs to current domain are kept, others are simply removed    *
     * ============================================================================ */
    if vcActivityCode = "Copy":U
    then do:
        SS_ID_BLOCK:
        do on error undo, leave SS_ID_BLOCK:
            /* ================================================================ *    
             * get GLSharedSet_ID DivSharedSet_ID of current domain             *
             * ================================================================ */
            <I-1 {bFcOpenInstance
                 &CLASS           = "Session"}>
                 
            <M-2 run GetIntegerValue
                (input  'SharedSetForGL':U (icName), 
                 output viGLSharedSetID (oiValue), 
                 output viFcReturnSuper (oiReturnStatus)) in Session>
            if viFcReturnSuper <  0 or (viFcReturnSuper > 0 and viLocalReturn = 0)
            then assign viLocalReturn = viFcReturnSuper.
            
            <M-3 run GetIntegerValue
               (input  'SharedSetForDIVISION':U (icName), 
                output viDivSharedSetID (oiValue), 
                output viFcReturnSuper (oiReturnStatus)) in Session>
            if viFcReturnSuper <  0 or (viFcReturnSuper > 0 and viLocalReturn = 0)
            then assign viLocalReturn = viFcReturnSuper.
        end. /* SS_ID_BLOCK: */
        
        if valid-handle(vhSessionInst)
        then do:
            <I-5 {bFcCloseInstance
                 &CLASS           = "Session"}>     
        end.
    
        if viLocalReturn < 0 then leave MAIN_BLOCK.
     
        /* ================================================================ *
         * Remove ranges from other Domains/Shared sets                     *
         * ================================================================ */
        for each tCOAMaskCCGL where
                 tCOAMaskCCGL.GLSharedSet_ID <> viGLSharedSetID and
                 tCOAMaskCCGL.tc_Status      = "N":U:
            delete tCOAMaskCCGL.
        end.

        for each tCOAMaskCCDiv where
                 tCOAMaskCCDiv.DivSharedSet_ID <> viDivSharedSetID and
                 tCOAMaskCCDiv.tc_Status       = "N":U:
            delete tCOAMaskCCDiv.
        end.
    end. /* if vcActivityCode = "Copy":U */
end. /* MAIN_BLOCK: */

assign oiReturnStatus = viLocalReturn.