project QadFinancials > class BFRWColumnGroup > method ValidateComponentPreAnCode

Description

Validate the analysis code.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BFRWColumnGroup.ValidateComponentPre


program code (program1/bfrwcolumngroup.p)

for each t_sFRWCol where
         t_sFRWCol.tc_Status <> 'D':U:
         
    for each t_sFRWColDet where
             t_sFRWColDet.tc_ParentRowid = t_sFRWCol.tc_Rowid and
             t_sFRWColDet.tc_Status <> 'D':U:
        
        /* Then analysis code is uniquely defined by Report chart and Analysis code */
        if t_sFRWColDet.tcFRWAnCodeCode = '':U or
           t_sFRWColDet.tcFRWAnCodeCode = ?
        then assign t_sFRWColDet.FRWAnCode_ID = 0.
        else do:
             <Q-42 run FRWAnCodeByCodeChart (all) (Read) (NoCache)
                (input ?, (FRWChartId)
                 input t_sFRWCol.tcFRWChartCode, (FRWChartCode)
                 input ?, (FRWAnCodeId)
                 input t_sFRWColDet.tcFRWAnCodeCode, (FRWAnCodeCode)
                 output dataset tqFRWAnCodeByCodeChart) in BFRWAnalysisCode>
            find tqFRWAnCodeByCodeChart where
                 tqFRWAnCodeByCodeChart.tcFRWChartCode  = t_sFRWCol.tcFRWChartCode and
                 tqFRWAnCodeByCodeChart.tcFRWAnCodeCode = t_sFRWColDet.tcFRWAnCodeCode
                 no-error.
            if available tqFRWAnCodeByCodeChart
            then assign t_sFRWColDet.FRWAnCode_ID = tqFRWAnCodeByCodeChart.tiFRWAnCode_ID.
            else do:
                assign vcMessage =  #T-48'Analysis code does not exist. (Report Chart = &1, Analysis Code = &2). Please re-enter.':255(109126553)T-48#
                       vcMessage = substitute(vcMessage, t_sFRWCol.tcFRWChartCode, t_sFRWColDet.tcFRWAnCodeCode). 
                <M-74 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'tFRWColDet.tcFRWAnCodeCode' (icFieldName), 
                    input  t_sFRWColDet.tcFRWAnCodeCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  t_sFRWColDet.tc_Rowid (icRowid), 
                    input  'qadfin-742971':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWColumnGroup>
                assign oiReturnStatus = -1.
            end. /* else if available tqFRWAnCodeByCodeChart */
        end. /* else if t_sFRWColDet.tcFRWAnCodeCode = '':U or */
    end. /* for each t_sFRWColDet where */
end. /* for each t_sFRWCol where */