Currency code checking in OnValidate of Table 81

Hi! I want to enter payment made by a customer in whose card no currency code is specified. The problem is that this payment should go to the bank account with specified currency. When I choose the customer I get the message “Currency code should be USD in the Customer No.=…” Thus, it means that if my customer wants to pay in different currencies I need to have some bank account with no currency code specified. But in card of such bank account I will see balance in my national currency only. In short I want to enter payments by one customer in different currencies and those payment should go to bank accounts with currency codes specified. Does somebody know a way of solving this problem? Thanks in advance.

quote:

IF “Bal. Account Type” = “Bal. Account Type”::“Bank Account” THEN BEGIN IF BankAcc3.GET(“Bal. Account No.”) AND (BankAcc3.“Currency Code” <> ‘’)THEN BankAcc3.TESTFIELD(“Currency Code”,“Currency Code”); END; IF “Account Type” = “Account Type”::“Bank Account” THEN BEGIN IF BankAcc3.GET(“Account No.”) AND (BankAcc3.“Currency Code” <> ‘’) THEN BankAcc3.TESTFIELD(“Currency Code”,“Currency Code”); END;

quote:

Attention When posting to a customer or vendor account on a journal line, if you use a bank account in the Account No. field or the Bal. Account No. field, the currency codes must be the same for the customer or vendor account and the bank account. I’m sorry, I can’t help you for this issue.

Hi relay to 2009R2 , on this topic …

When changing currency code on Gen. Journal Lines for Bank Account Lines , (which not suppose to )

Why would the error message says : " Currency Code must be USD in Bank Account No. WWW-EUR " !?!!?

While **EUR (**as default currency for WWW-EUR, see Cronus) , USD was the value fail to pass Testfield.

Should it say " Currency Code must be EUR in Bank Account No. WWW-EUR "

What happen to the Testfield function here??

Account" THEN BEGIN

T00081 , Currency Code - on Validate ()

IF “Bal. Account Type” = “Bal. Account Type”::"Bank

IF BankAcc3.GET(“Bal. Account No.”) AND (BankAcc3.“Currency Code” <> ‘’)THEN

BankAcc3.TESTFIELD(“Currency Code”,“Currency Code”);
END;

Is it a known bug or just me ? (I can’t change testfield error message , can i ? )

As Bank WWB-EUR has Currency code EUR in its card…it is bydefault shown on General Journal Line.

When you try to change it to USD, it is showing error message that bank WWB-EUR should have USD in its Currency Code field…then only you can use USD in General Journal Line…

Hope you understood …

-. - ya… you can say things like that …

Then NAV must be suggesting my user to change the cur code in their Bank Card ? (which is non-sense) (then NAV would be a very lamb product by adding these silly messages one by one altogether…

Just thinking in the normal way for Testfield message .

Testfield always give the field name and suggest what the value should be

customer.Testfield ( “balance(LCY)” , 0 ) ;

message: [ balance(LCY) should be 0 ]

I was wonder if it’s a mistake to not specific table name in this function,

BankAcc3.TESTFIELD(“Currency Code”,“Currency Code”);

Now I wonder why dont write it by

Journal line. Testfield (“currency code” , Bankacc3.“currency code”) ?

thank mohana.

NO - Nav informs you that currencies do not match, displaying what currency it expects according to already selected BankAcc and will not accept any other. BankAcc currency must correspond to one in Journal.

You can either:

  1. select different BankAcc with matching currency
  2. change currency in Journal to atch it with selected BankAcc’s currency

and no errors, mistakes or bugs here - Mohana already answered you, I tried to rephrase his answer.

hmmm if u read that message again… it expects USD to be set on my Bank Card WWW-EUR.

Well, Rics - get used to Navision message “language” [:)]

All msg texts are composed from little “snippets”, there is NO dedicated text for every situation. Therefore, sometimes the message may seem inappropriate or clumsy. In this certain case, the msg should be understood just as Mohana and I tried to rephrase it…

English grammar is simple and straightforward, it allows such combining of words/phrases and the result in most cases is grammatically correct (and understandable). If you had seen, WHAT happens in other languages with such approach… In my native Latvian, the messages are totally unreadable - I’ve had to switch to English and repeat the action, then, getting msg in English, I was able to understand what it was all about.

Remember, that Navision has a long history, it started as DOS program, and in it’s “childhood” we didn’t measure our HDDs in TERAbytes and RAM in GIGAbytes. Saving space was essential, therefore such approach was used.