project QadFinancials > class BPaymentCondition > method ValBetweenZeroAndHundred

validation procedure

Description

Checks if the value is >= 0 and <= 100


Parameters


idTargetFieldinputdecimalValue of the field to validate.
icTargetFieldNameinputcharacterName of the field to validate. Use the database field name or public data item name.
Example : 'Order.Order-Num'.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on tPaymentCondition.PaymentConditionPercentage
validation on tPaymentConditionStaged.PaymentConditionStagedPerc


program code (program4/bpaymentcondition.p)

if   (idTargetField <  0 or idTargetField > 100)
then do:
    assign oiReturnStatus = -1
           vcMessage      = trim(substitute(#T-3'The value of &1 must be between 0 and 100. The current value of &3 is &2.':250(59799)t-3#, trim(icTargetFieldName), trim(string(idTargetField)),trim(icTargetFieldName))).
    <M-1 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  icTargetFieldName (icFieldName),
                     input  string(idTargetField) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  icRowid (icRowid),
                     input  'QADFIN-131':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BPaymentCondition>
end.