project QadFinancials > class BCurrency > method ValidateBusinessKey

Description

This method will be called by ValidateComponent.
It is not possible to change the Currency Code value for the currency as this is a key value that is used in MFG/PRO, the financials can handle these changes as they used the Currency_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 BCurrency.ValidateComponent


program code (program1/bcurrency.p)

for each t_sCurrency where t_sCurrency.tc_Status = 'C':U,
    each t_iCurrency where t_iCurrency.tc_rowid=t_sCurrency.tc_rowid and
        t_iCurrency.CurrencyCode <> t_sCurrency.CurrencyCode:
    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  'CurrencyCode':U (icFieldName), 
        input  t_sCurrency.CurrencyCode (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '' (icRowid), 
        input  'QadFin-4714':U (icFcMsgNumber), 
        input  '' (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BCurrency>
    return.
end. /* for each tCurrency */