project QadFinancials > class BBankImportLine > method StopAndCloseExternalInstances

Description

This method stops and closes all esternal instnaces


Parameters


ilIsCloseOnlyinputlogicalOnly Close Instance
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankImportLine.ApiProcessBankImpLineNewBankEntry
method BBankImportLine.ProcessBankImpLineNewDDocument
method BBankImportLine.SaveAndProcess


program code (program6/bbankimportline.p)

/* =================================================================================================== */
/* Method      : StopAndCloseExternalInstances                                                         */
/* Desc        : This method closes and stops all external instances                                   */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* BBankEntry                                                                                          */
/* =================================================================================================== */
if ilIsCloseOnly
then do:
    if valid-handle(vhBBankEntryInst)
    then do:
        <I-1 {bFcCloseInstance
             &CLASS           = "BBankEntry"}>
    end.
end.
else do:
    if valid-handle(vhBBankEntryInst)
    then do:
        <I-3 {bFcCloseAndStopInstance
             &CLASS           = "BBankEntry"}>
    end.
    else if viBBankEntryID <> 0 and
            viBBankEntryID <> ?
    then do:
        <I-4 {bFcStopInstance
             &CLASS           = "BBankEntry"}>
    end.
end.
assign viBBankEntryID = ?.

/* =================================================================================================== */
/* BBusinessRelation                                                                                         */
/* =================================================================================================== */
if ilIsCloseOnly
then do:
    if valid-handle(vhBBusinessRelation3Inst)
    then do:
        <I-10 {bFcCloseInstance
             &CLASS           = "BBusinessRelation"}>
    end.
end.
else do:
     if valid-handle(vhBBusinessRelation3Inst)
    then do:
        <I-11 {bFcCloseAndStopInstance
             &CLASS           = "BBusinessRelation"}>
    end.
    else if viBBusinessRelation3ID <> 0 and
            viBBusinessRelation3ID <> ?
    then do:
        <I-12 {bFcStopInstance
             &CLASS           = "BBusinessRelation"}>
    end.
end.
assign viBBusinessRelation3ID = ?.

/* BDPaymentSelection*/
if ilIsCloseOnly
then do:
    if valid-handle(vhBDPaymentSelection9Inst)
    then do:
        <I-86 {bFcCloseInstance
             &CLASS           = "BDPaymentSelection"}>
    end.
end.
else do:
     if valid-handle(vhBDPaymentSelection9Inst)
    then do:
        <I-53 {bFcCloseAndStopInstance
             &CLASS           = "BDPaymentSelection"}>
    end.
    else if viBDPaymentSelection9ID <> 0 and
            viBDPaymentSelection9ID <> ?
    then do:
        <I-96 {bFcStopInstance
             &CLASS           = "BDPaymentSelection"}>
    end.
end.
assign viBDPaymentSelection9ID = ?.

/* =================================================================================================== */
/* BCDocument                                                                                          */
/* =================================================================================================== */
if ilIsCloseOnly
then do:
    if valid-handle(vhBCDocumentBankImpLineInst)
    then do:
        <I-13 {bFcCloseInstance
             &CLASS           = "BCDocument"}>
    end.
end.
else do:
     if valid-handle(vhBCDocumentBankImpLineInst)
    then do:
        <I-14 {bFcCloseAndStopInstance
             &CLASS           = "BCDocument"}>
    end.
    else if viBCDocumentBankImpLineID <> 0 and
            viBCDocumentBankImpLineID <> ?
    then do:
        <I-15 {bFcStopInstance
             &CLASS           = "BCDocument"}>
    end.
end.

/* =================================================================================================== */
/* BDDocument                                                                                          */
/* =================================================================================================== */
if ilIsCloseOnly
then do:
    if valid-handle(vhBDDocumentBankImpLineInst)
    then do:
        <I-16 {bFcCloseInstance
             &CLASS           = "BDDocument"}>
    end.
end.
else do:
     if valid-handle(vhBDDocumentBankImpLineInst)
    then do:
        <I-17 {bFcCloseAndStopInstance
             &CLASS           = "BDDocument"}>
    end.
    else if viBDDocumentBankImpLineID <> 0 and
            viBDDocumentBankImpLineID <> ?
    then do:
        <I-18 {bFcStopInstance
             &CLASS           = "BDDocument"}>
    end.
end.
assign viBDDocumentBankImpLineID = ?.

/* =================================================================================================== */
/* Return                                                                                              */
/* =================================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.