project QadFinancials > class BDebtorShipTo > method StopExternalInstances

Description

Stop instances that are started in AdditionalUpdates as part of current transaction


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDebtorShipTo.AdditionalUpdates
method BDebtorShipTo.ApiCreateDebtorShipto
method BDebtorShipTo.ApiMaintainDebtorShipto
method BDebtorShipTo.DataLoadByInput
method BDebtorShipTo.ValidateComponent


program code (program/bdebtorshipto.p)

MAIN_BLOCK:
do on error undo, return:

    assign oiReturnStatus      = -98
           viLocalReturnStatus = 0.

    /* ================================================================= *
     * BBusinessRelation component                                       *
     * ================================================================= */
    if vlIsBBusinessRelationStartedHr and
       viBBusinessRelation1ID <> 0    and
       viBBusinessRelation1ID <> ?
    then do:
        if valid-handle(vhBBusinessRelation1Inst)
        then do:
            <I-93 {bFcCloseAndStopInstance
                 &CLASS           = "BBusinessRelation"}>
        end.
        else do:
            <I-98 {bFcStopInstance
                 &CLASS           = "BBusinessRelation"}>
        end.

        assign vlIsBBusinessRelationStartedHr = false
               vlIsBBusinessRelationOpenedHr  = false
               viBBusinessRelation1ID         = 0.
    end.   

    /* ================================================================= *
     * BMfgAddress component                                             *
     * ================================================================= */
    if  vlIsBMfgAddressStartedHr and
        viBMfgAddress2ID <> 0    and
        viBMfgAddress2ID <> ?
    then do :
         if valid-handle(vhBMfgAddress2Inst)
         then do:
             <I-94 {bFcCloseAndStopInstance
                  &CLASS           = "BMfgAddress"}>
         end.
         else do:
            <I-61 {bFcStopInstance
                 &CLASS           = "BMfgAddress"}>
         end.
    
         assign vlIsBMfgAddressStartedHr = false
                vlIsBMfgAddressOpenedHr  = false
                viBMfgAddress2ID         = 0.
    end.
    
    /* ================================================================= *
     * BMfgAddressListDetail component                                   *
     * ================================================================= */           
    if vlIsBMfgAddressListStartedHr    and
       viBMfgAddressListDetail6ID <> 0 and
       viBMfgAddressListDetail6ID <> ?
    then do:
        if valid-handle(vhBMfgAddressListDetail6Inst)
        then do:
             <I-89 {bFcCloseAndStopInstance
                  &CLASS           = "BMfgAddressListDetail"}>
        end.
        else do:
            <I-3 {bFcStopInstance
                 &CLASS           = "BMfgAddressListDetail"}>
         end.
         assign vlIsBMfgAddressListStartedHr = false
                vlIsBMfgAddressListOpenedHr  = false
                viBMfgAddressListDetail6ID   = 0.
    end.
    
    <ANCESTOR-CODE>
end.

assign oiReturnStatus = viLocalReturnStatus.