project QadFinancials > class BDInvoice > method ValDebtorId

validation procedure

Description

Validates if the debtors are active and not on credit hold.


Parameters


iiTargetFieldinputintegerValue 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.
ilActiveinputlogicalActive flag
ilLockedinputlogical
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.DefaultValuesValidate


program code (program5/bdinvoice.p)

if not ilActive
then do:
    assign vcMessage      = #T-2'You can only specify active customers.':150(1763)t-2#
           oiReturnStatus = -1.

    <M-1 run SetMessage (input  vcMessage (icMessage), 
                     input  '':U (icArguments), 
                     input  icTargetFieldName (icFieldName), 
                     input  string(iiTargetField) (icFieldValue), 
                     input  'E':U (icType), 
                     input  3 (iiSeverity), 
                     input  icRowid (icRowid), 
                     input  'QADFIN-413':U (icFcMsgNumber), 
                     input  '' (icFcExplanation), 
                     input  '' (icFcIdentification), 
                     input  '' (icFcContext), 
                     output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
end.

if ilLocked
then do:
    assign vcMessage      = #T-4'This customer is on credit hold.':150(64033)t-4#.
    if(oiReturnStatus >= 0) then oiReturnStatus = 1.

    <M-3 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  string(iiTargetField) (icFieldValue), 
        input  'W':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QADFIN-3065':U (icFcMsgNumber), 
        input  '' (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
end.