project BLF > class BSODPolicyException > 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/bsodpolicyexception.p)

<ANCESTOR-CODE>

/* ================================================================= */
/* Fill in domain or entity, but not both.                           */
/* ================================================================= */
for each t_sSODExceptionLn where
    /* check on filled in codes */
       ((t_sSODExceptionLn.tcDomainCode <> "" and
         t_sSODExceptionLn.tcDomainCode <> ? and
         t_sSODExceptionLn.tcCompanyCode <> "" and
         t_sSODExceptionLn.tcCompanyCode <> ?) or
    /* check on filled in id's */
        (t_sSODExceptionLn.tcDomainCode = ? and
         t_sSODExceptionLn.tcCompanyCode = ? and
         t_sSODExceptionLn.Domain_ID <> 0 and
         t_sSODExceptionLn.Company_ID <> 0)) and
    /* ignore delete */
         t_sSODExceptionLn.tc_Status <> "D" on error undo, throw:
    oiReturnStatus = -1.
    <M-1 run SetMessage
       (input  #T-1'Domain and Entity should not both be filled in.':255(733756598)T-1# (icMessage), 
        input  '' (icArguments), 
        input  'tSODExceptionLn.tcCompanyCode' (icFieldName), 
        input  t_sSODExceptionLn.tcCompanyCode (icFieldValue), 
        input  'E' (icType), 
        input  3 (iiSeverity), 
        input  t_sSODExceptionLn.tc_Rowid (icRowid), 
        input  'BLF-250':U (icFcMsgNumber), 
        input  '' (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BSODPolicyException>
end.