project QadFinancials > class BBudgetLinkAccDet > 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/bbudgetlinkaccdet.p)

    
    /* ============================================================== */
    /* Avoid having NULL values in fields belonging to a unique index */
    /* ============================================================== */
    for each t_sBudgetLinkAccDet where
             t_sBudgetLinkAccDet.tc_Status = "N":U or 
             t_sBudgetLinkAccDet.tc_Status = "C":U  :
        if t_sBudgetLinkAccDet.Division_ID = ?
        then assign t_sBudgetLinkAccDet.Division_ID = 0.
        if t_sBudgetLinkAccDet.CostCentre_ID = ?
        then assign t_sBudgetLinkAccDet.CostCentre_ID = 0.
        if t_sBudgetLinkAccDet.Project_ID = ?
        then assign t_sBudgetLinkAccDet.Project_ID = 0.
        if t_sBudgetLinkAccDet.Saf_ID = ?
        then assign t_sBudgetLinkAccDet.Saf_ID = 0.       
        if t_sBudgetLinkAccDet.BudgetWBS_ID = ?
        then assign t_sBudgetLinkAccDet.BudgetWBS_ID = 0.
        if t_sBudgetLinkAccDet.Layer_ID = ?
        then assign t_sBudgetLinkAccDet.Layer_ID = 0.
        if t_sBudgetLinkAccDet.Period_ID = ?
        then assign t_sBudgetLinkAccDet.Period_ID = 0.
    end. /* for each t_sBudgetLinkAccDet where */
    

    
    
<ANCESTOR-CODE>