project QadFinancials > class BAPMatching > method ValPeriod

validation procedure


Parameters


icTargetFieldinputcharacterValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
icPeriodStatusinputcharacter
ilPeriodIsPostingGLAllowedinputlogical
ilPeriodIsPostingPurchAllowinputlogicalPeriod.PeriodIsPostingPurchAllow
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on relation PERIODINAPMATCHING


program code (program4/bapmatching.p)

if icPeriodStatus <> {&PERIODSTATUS-OPEN}
    then do:
        <M-1 run SetMessage
          (input  trim(#T-1'The selected GL period must have status $1.':250(49038)T-1#) (icMessage), 
           input  {&PERIODSTATUS-OPEN-TR} (icArguments), 
           input  icTargetFieldName (icFieldName), 
           input  icTargetField (icFieldValue), 
           input  'E':U (icType), 
           input  3 (iiSeverity), 
           input  icRowid (icRowid), 
           input  'QadFin-5233':U (icFcMsgNumber), 
           input  '':U (icFcExplanation), 
           input  '':U (icFcIdentification), 
           input  '':U (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        assign oiReturnStatus = -1.
    end.
    
    if ilPeriodIsPostingGLAllowed <> true
    then do:
        <M-2 run SetMessage
          (input  trim(#T-2'The selected GL period must be open for postings.':250(49039)T-2#) (icMessage), 
           input  '':U (icArguments), 
           input  icTargetFieldName (icFieldName), 
           input  icTargetField (icFieldValue), 
           input  'E':U (icType), 
           input  3 (iiSeverity), 
           input  icRowid (icRowid), 
           input  'QadFin-5234':U (icFcMsgNumber), 
           input  '':U (icFcExplanation), 
           input  '':U (icFcIdentification), 
           input  '':U (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        assign oiReturnStatus = -1.
    end.

    find first t_sAPMatching where t_sAPMatching.tc_Rowid = icRowid no-error.
    if not available t_sAPMatching
    then return.

    if ilPeriodIsPostingPurchAllow <> true            and
       t_sAPMatching.tlCInvoiceIsInitialStatus = true
    then do:
        <M-3 run SetMessage
           (input  trim(#T-4'The selected GL period must be open for AP transactions.':250(65001)t-4#) (icMessage), 
            input  '':U (icArguments), 
            input  icTargetFieldName (icFieldName), 
            input  icTargetField (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  icRowid (icRowid), 
            input  'QadFin-6881':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        assign oiReturnStatus = -1.
    end.