project QadFinancials > class BCountry > method ValidateComponentCountryCodeChanges

Description

It is not possible to change the Country Code value for the country as this is a key value that is used in MFG/PRO, the financials can handle these changes as they use the Country_ID for foreign key relationships but it will cause major data integrity problems within MFG/PRO if this data is allowed to change.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCountry.ValidateComponent


program code (program4/bcountry.p)

/* Check that the primary cannot be changed in modify mode */
    for each t_sCountry where 
             t_sCountry.tc_Status = 'C':U,
        each t_iCountry where 
             (t_iCountry.tc_rowid     = t_sCountry.tc_rowid and
             t_iCountry.CountryCode <> t_sCountry.CountryCode):
        assign vcMessageText  =  #T-1'Cannot change key field value.':30(17937)T-1#
               oiReturnStatus = -1.
        <M-2 run SetMessage
           (input  vcMessageText (icMessage), 
            input  '' (icArguments), 
            input  'tCountry.CountryCode':U (icFieldName), 
            input  t_sCountry.CountryCode (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '' (icRowid), 
            input  'QadFin-4713':U (icFcMsgNumber), 
            input  '' (icFcExplanation), 
            input  '' (icFcIdentification), 
            input  '' (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BCountry>
    end. /* for each tCountry */