project QadFinancials > class BFRWReportMaster > method ValidateComponentPost

Description

Post validation method.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BFRWReportMaster.ValidateComponent


program code (program1/bfrwreportmaster.p)

/* ================================================================= */
/* Check that the report chart exists before continuing              */
/* ================================================================= */

for each t_sFRWRepMstr where
         t_sFRWRepMstr.tc_Status = 'N':U:
              
    <Q-29 run FRWChartPrim (all) (Read) (NoCache)
       (input ?, (FRWChart_ID)
        input t_sFRWRepMstr.tcFRWChartCode, (FRWChartCode)
        output dataset tqFRWChartPrim) in BFRWChart>
     
     find first tqFRWChartPrim where
                tqFRWChartPrim.tcFRWChartCode = t_sFRWRepMstr.tcFRWChartCode no-error.
            
     if not available tqFRWChartPrim
     then do:
         <M-71 run SetMessage
            (input  #T-30'Report Chart code does not exist. Please re-enter.':255(545671204)T-30# (icMessage), 
             input  '':U (icArguments), 
             input  'tFRWRepMstr.tcFRWChartCode':U (icFieldName), 
             input  t_sFRWRepMstr.tcFRWChartCode (icFieldValue), 
             input  'E':U (icType), 
             input  3 (iiSeverity), 
             input  t_sFRWRepMstr.tc_Rowid (icRowid), 
             input  'qadfin-570079':U (icFcMsgNumber), 
             input  '':U (icFcExplanation), 
             input  '':U (icFcIdentification), 
             input  '':U (icFcContext), 
             output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
          assign oiReturnStatus = -1.
     end.
     else do:
         assign t_sFRWRepMstr.FRWChart_ID = tqFRWChartPrim.tiFRWChart_ID.
     end.
     
end.    /* for each t_sFRWRepMstr where */

/* ================================================================================== */
/*  Check that the report tree code exists and is part of the selected report chart   */
/* ================================================================================== */

for each t_sFRWRepMstr where
         t_sFRWRepMstr.tc_Status <> 'D':U:

    <Q-38 run ReportTreeForAllData (all) (Read) (NoCache)
       (input t_sFRWRepMstr.tcFRWTreeNodeCode, (FRWTreeNodeCode)
        input t_sFRWRepMstr.tcFRWTreeNodeDescription, (FRWTreeNodeDescription)
        output dataset tqReportTreeForAllData) in BReportTree>
    
    find first tqReportTreeForAllData where
               tqReportTreeForAllData.tcFRWTreeNodeCode        = t_sFRWRepMstr.tcFRWTreeNodeCode
               no-error.
    
    if available tqReportTreeForAllData
    then assign t_sFRWRepMstr.FRWTreeNode_ID = tqReportTreeForAllData.tiFRWTreeNode_ID.
    else do: 
        assign vcMessage      = trim(#T-57'Report Tree code does not exist or belongs to another Report Chart. Please re-enter.':255(43083198)T-57#)
               oiReturnStatus = -1.
        <M-45 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  'tFRWRepMstr.tcFRWTreeNodeCode':U (icFieldName), 
            input  t_sFRWRepMstr.tcFRWTreeNodeCode (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  t_sFRWRepMstr.tc_Rowid (icRowid), 
            input  'qadfin-645761':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
    
    end. /* if available tqReportTreeForAllData */
            
end.     /* for each t_sFRWRepMstr where */
    
/* ======================================================================= */
/* Check that the column group exists and that is part of the chart code   */
/* ======================================================================= */

for each t_sFRWRepMstr where
         t_sFRWRepMstr.tc_Status <> 'D':U:

    /* the column group is uniquely identified by the report chart code and column group code */
    <Q-96 run ColumnGroupByCodeChart (all) (Read) (NoCache)
       (input ?, (FRWChartId)
        input ?, (FRWColId)
        input t_sFRWRepMstr.tcFRWColCode, (FRWColCode)
        input t_sFRWRepMstr.tcFRWChartCode, (FRWChartCode)
        output dataset tqColumnGroupByCodeChart) in BFRWColumnGroup>

    find tqColumnGroupByCodeChart where
         tqColumnGroupByCodeChart.tcFRWColCode   = t_sFRWRepMstr.tcFRWColCode and
         tqColumnGroupByCodeChart.tcFRWChartCode = t_sFRWRepMstr.tcFRWChartCode
         no-error.
         
    if available tqColumnGroupByCodeChart
    then assign t_sFRWRepMstr.FRWCol_ID = tqColumnGroupByCodeChart.tiFRWCol_ID.
    else do:
        assign vcMessage      = trim(#T-55'Column Group does not exist or belongs to another Report Chart. Please re-enter.':255(611403569)T-55#)
               oiReturnStatus = -1.
        <M-46 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  'tFRWRepMstr.tcFRWColCode':U (icFieldName), 
            input  t_sFRWRepMstr.tcFRWColCode (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  t_sFRWRepMstr.tc_Rowid (icRowid), 
            input  'qadfin-380802':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
    end.  /* else do: */

end.    /* for each t_sFRWRepMstr where */