project QadFinancials > class BFRWReportMaster > method ValidateComponent

Description

Write here all tests on database update (new / modify / delete) that cannot be coded with a validation mask.
The type of update can be found in tc_status (N/C/D).
If you find incorrect data, you must write an entry in tFcMessages (using SetMessage) and set the return status of this method to either +1 or -1.
Return status +1 = data will still be accepted.
Return status -1 = data will not be accepted.
This method is run from SetPublicTables, before transferring the received data into the class temp-tables.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bfrwreportmaster.p)

<M-92 run ValidateComponentPre  (output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.

assign viLocalReturn = oiReturnStatus
       oiReturnStatus = 0.

<ANCESTOR-CODE>
for each t_sFRWRepMstr where
         t_sFRWRepMstr.tc_Status <> "D":U:
    message t_sFRWRepMstr.FRWRepMstrNumberOfDecimals.
    if t_sFRWRepMstr.FRWRepMstrNumberOfDecimals < 0 or
       t_sFRWRepMstr.FRWRepMstrNumberOfDecimals > 3 or
       t_sFRWRepMstr.FRWRepMstrNumberOfDecimals = ? 
    then do:
          <M-5 run SetMessage
             (input  #T-54'Number of decimals must be 0, 1, 2 or 3.':255(588697699)T-54# (icMessage), 
              input  ? (icArguments), 
              input  ? (icFieldName), 
              input  ? (icFieldValue), 
              input  'E':U (icType), 
              input  3 (iiSeverity), 
              input  ? (icRowid), 
              input  'qadfin-284669':U (icFcMsgNumber), 
              input  ? (icFcExplanation), 
              input  ? (icFcIdentification), 
              input  ? (icFcContext), 
              output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
        assign oiReturnStatus = -1.
        return.
    end.
end.

if viLocalReturn < 0 or viLocalReturn > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viLocalReturn.

<M-73 run ValidateComponentPost  (output viFcReturnSuper (oiReturnStatus)) in BFRWReportMaster>
if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.