project QadFinancials > class BSharedSetMergeLog > method GetOngoingMergeInfo

Description

This method retrieves information whether there is any not completed merge or not and information about this merge.


Parameters


olIsThereOngoingMergeoutputlogical
ocMasterSharedSetCodeoutputcharacter
ocRedundantSharedSetCodeoutputcharacter
ocSharedSetTypeoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BSharedSetMerge.GetOngoingMergeInfo


program code (program6/bsharedsetmergelog.p)

/* =================================================================================================== */
/* Method      : GetNotFinishedSSMerge                                                                 */
/* Desc        : This method retrieves information whether there is any not completed merge or not and */
/*               information about this merge.                                                         */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (O)  IsThereOngoingMerge  Flag indicating, whether there is any ongoing - not finished     */
/*                                    Merge                                                            */
/*          (O)  MasterSharedSet      Code of master shared set (? if not ongoing)                     */
/*          (O)  RedundantSharedSet   Code of redundant shared set (? if not ongoing)                  */
/*          (O)  SharedSetType        Code of shared set type (? if not ongoing)                       */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Default output values                                                                               */
/* =================================================================================================== */
assign olIsThereOngoingMerge    = false
       ocMasterSharedSetCode    = ?
       ocRedundantSharedSetCode = ?
       ocSharedSetType          = ?.

/* =================================================================================================== */
/* Load not finished merge log record                                                                  */
/* =================================================================================================== */
<Q-1 run SharedSetMergeLogByFinished (all) (Read) (NoCache)
   (input false, (IsFinished)
    output dataset tqSharedSetMergeLogByFinished) in BSharedSetMergeLog >

find first tqSharedSetMergeLogByFinished where
           tqSharedSetMergeLogByFinished.tlSharedSetMergeLogIsFinish = false no-error.
if available tqSharedSetMergeLogByFinished
then do:
    assign olIsThereOngoingMerge    = true
           ocMasterSharedSetCode    = tqSharedSetMergeLogByFinished.tcSharedSetMergeLogMaster
           ocRedundantSharedSetCode = tqSharedSetMergeLogByFinished.tcSharedSetMergeLogRedundant.

    /* Get shared set type code */
    <Q-2 run SharedSetByCode (all) (Read) (NoCache)
       (input ocMasterSharedSetCode, (SharedSetCode)
        output dataset tqSharedSetByCode) in BSharedSet >
    find first tqSharedSetByCode where
               tqSharedSetByCode.tcSharedSetCode = ocMasterSharedSetCode no-error.
    if not available tqSharedSetByCode
    then do:
        assign vcMessage = #T-4'There is no shared set defined for shared set code &1.':255(63917)t-4#
               vcMessage = substitute(vcMessage, ocMasterSharedSetCode).
        <M-3 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'S':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-6613':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BSharedSetMergeLog>
        assign oiReturnStatus = -1.
        return.
    end.

    assign ocSharedSetType = tqSharedSetByCode.tcSharedSetTypeCode.
end.

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