project QadFinancials > class BReportPeriod > 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.

Validations:
Ancestor Code
Validate that the report period cannot be deleted when it is reported.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/breportperiod.p)

<ANCESTOR-CODE>
    
    /* ========================================= */
    /* Cannot be deleted when it is reported     */
    /* ========================================= */
    for each t_sReportPeriod where
             t_sReportPeriod.tc_Status              = "D":U and 
             t_sReportPeriod.ReportPeriodIsReported = true
             no-lock:
        assign vcMsgRepPd     = trim(substitute(#T-2'You cannot delete a reporting period (&1/&2) that has been reported.':255(3546)t-2#,string(t_sReportPeriod.ReportPeriodYear),string(t_sReportPeriod.ReportPeriodPeriod)))
               oiReturnStatus = -1.
        <M-1 run SetMessage
           (input  vcMsgRepPd (icMessage), 
            input  '':U (icArguments), 
            input  'tReportPeriod.ReportPeriodIsReported':U (icFieldName), 
            input  t_sReportPeriod.ReportPeriodIsReported (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  t_sReportPeriod.tc_Rowid (icRowid), 
            input  'QADFIN-964':U (icFcMsgNumber), 
            input  '' (icFcExplanation), 
            input  '' (icFcIdentification), 
            input  '' (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BReportPeriod>
    end. /* for each t_sReportPeriod where */