project QadFinancials > class BBusinessRelation > method ValVatNumber

validation procedure

Description

Validate a VAT Number on validity and give errors if necessary


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.
iiCountryIdinputintegercountry ID
icCountryCodeinputcharacterCountry Code
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on tVatNumber.VatNumberDeclaration
validation on tVatNumber.VatNumberIdentity


program code (program5/bbusinessrelation.p)

assign vhFcComponent = ?.
    
    <M-1 run ApiCheckVatNumber
       (input  iiCountryId (iiCountryId), 
        input  icCountryCode (icCountryCode), 
        input  icTargetField (icVatNumber), 
        input  true (ilMessage), 
        output vcVatNumberShort (ocVatNumberShort), 
        output vcVatNumberLong (ocVatNumberLong), 
        output viFcReturnSuper (oiReturnStatus)) in BCountry>
    if viFcReturnSuper < 0 or 
      (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 
    then return.