project QadFinancials > class BReportPeriod > method DataLoadMultiple

Description

This method will load the period records for an accounting year.


Parameters


iiReportPeriodYearinputintegerThe year from which you want all the period records
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/breportperiod.p)

/* ======================== */
    /* Validate input parameter */
    /* ======================== */
    if iiReportPeriodYear = 0
    then do:
        assign vcMsgRepPd     = trim(#T-10'Enter the reporting year you want to load.':255(3544)T-10#)
               oiReturnStatus = -1.
        <M-5 run SetMessage (input  vcMsgRepPd (icMessage),
                     input  '':U (icArguments),
                     input  'tReportPeriod.ReportPeriodYear':U (icFieldName),
                     input  tReportPeriod.ReportPeriodYear (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  tReportPeriod.tc_Rowid (icRowid),
                     input  'QADFIN-981':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BReportPeriod>        
        Return.
    end. /* if iiReportPeriodYear = 0 */
    
    /* ====================================================================== */
    /* first clear the instance, otherwise problems when you execute it twice */
    /* ====================================================================== */
    <M-6 run ClearData (output viFcReturnSuper (oiReturnStatus)) in BReportPeriod>
    if viFcReturnSuper <> 0
    then do:
        assign oiReturnStatus = viFcReturnSuper.
        return.
    end. /* if viFcReturnSuper <> 0 */

    /* ========================================== */
    /* load the period records for the input year */
    /* ========================================== */
    <Q-7 run ReportPeriodByAllInfo (all) (Read) (NoCache)
          (input ?, (ReportPeriodID)
           input iiReportPeriodYear, (ReportPeriodYear)
           input ?, (ReportPeriodPeriod)
           input ?, (ReportPeriodStartDate)
           input ?, (ReportPeriodEndDate)
           input ?, (ReportPeriodIsReported)
           output dataset tqReportPeriodByAllInfo) in BReportPeriod >
    for each tqReportPeriodByAllInfo where
             tqReportPeriodByAllInfo.tiReportPeriodYear = iiReportPeriodYear
             no-lock:
        <M-8 run DataLoad
          (input  '':U (icRowids), 
           input  tqReportPeriodByAllInfo.tiReportPeriod_ID (icPkeys), 
           input  '':U (icObjectIds), 
           input  '' (icFreeform), 
           input  true (ilKeepPrevious), 
           output viFcReturnSuper (oiReturnStatus)) in BReportPeriod>
        if viFcReturnSuper <> 0
        then do:
            assign vcMsgRepPd     = trim(#T-11'Internal error. The system could not load the data.':255(3545)t-11#)
                   oiReturnStatus = viFcReturnSuper.
            <M-9 run SetMessage (input  vcMsgRepPd (icMessage),
                     input  '':U (icArguments),
                     input  '':U (icFieldName),
                     input  '':U (icFieldValue),
                     input  'S':U (icType),
                     input  1 (iiSeverity),
                     input  '':U (icRowid),
                     input  'QADFIN-982':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BReportPeriod> 
            return.
        end. /* if viFcReturnSuper <> 0 */
    end. /* for each tqReportPeriodByAllInfo */