project QadFinancials > class BCreditorBalance > 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/bcreditorbalance.p)

/* ============================================================== */
/* Avoid having NULL values in fields belonging to a unique index */
/* ============================================================== */
for each t_sCHist where
         t_sCHist.tc_Status = 'N' or
         t_sCHist.tc_Status = 'C':      
    if t_sCHist.Division_ID = ?
    then assign t_sCHist.Division_ID = 0.
    if t_sCHist.CostCentre_ID = ?
    then assign t_sCHist.CostCentre_ID = 0.
    if t_sCHist.Project_ID = ?
    then assign t_sCHist.Project_ID = 0.
end. /* for each t_sCHist: */

<ANCESTOR-CODE>