project QadFinancials > class BFRWAnalysisCode > 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/bfrwanalysiscode.p)

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

if oiReturnStatus < 0 then return.

assign viLocalReturn  = oiReturnStatus
       oiReturnStatus = 0.

/* Workaround - field FRWAnCodeElemDebCode is mandatory - for operational it means not ? but for CB it means not ? and "" *
 *              Because oper expects also blank value = "", we have to give CB validation slightly different value        */
for each t_sFRWAnCodeElemDet where
         t_sFRWAnCodeElemDet.FRWAnCodeElemDetValue = 0 and
         t_sFRWAnCodeElemDet.tc_Status            <> "D":U:
    assign t_sFRWAnCodeElemDet.FRWAnCodeElemDetCode = "<BLANK>":U.
end.

<ANCESTOR-CODE>

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


/* Workaround - field FRWAnCodeElemDebCode is mandatory - for operational it means not ? but for CB it means not ? and "" *
 *              Because oper expects also blank value = "", we have to give CB validation slightly different value        */
for each t_sFRWAnCodeElemDet where
         t_sFRWAnCodeElemDet.FRWAnCodeElemDetValue = 0 and
         t_sFRWAnCodeElemDet.tc_Status            <> "D":U:
    assign t_sFRWAnCodeElemDet.FRWAnCodeElemDetCode = "":U.
end.

if oiReturnStatus < 0 then return.

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