Currency table Security error when assigning item charges

KYDutchieKYDutchie Member Posts: 345
Hi all,

I am not sure if this is a bug or I am doing something wrong.
This is my problem. My customer did not purchase the 3760 Multi-currency granule and therefor has no access to the Currency table. They can only use a blank currency code.
They are using Item Charges. But when they try to assign an item charge in the purchase line, they get the error "You do not have permission to read the Currency table." when they enter the Qty to assign.

So I looked at the code in table 5805 "Item Charge Assignment (Purch)". And unlike everywhere else I noticed that the currency code is not checked before reading the currency table. This happens on the "Amount to Assign" Field.
PurchLine.GET("Document Type","Document No.","Document Line No.");
IF NOT Currency.GET(PurchLine."Currency Code") THEN
  Currency.InitRoundingPrecision;
"Amount to Assign" := ROUND("Qty. to Assign" * "Unit Cost",Currency."Amount Rounding Precision");

I could get around this problem by coding the Trigger like this:
PurchLine.GET("Document Type","Document No.","Document Line No.");
IF PurchLine."Currency Code" <> '' THEN BEGIN
  IF NOT Currency.GET(PurchLine."Currency Code") THEN
    Currency.InitRoundingPrecision;
END ELSE
  Currency.InitRoundingPrecision;

"Amount to Assign" := ROUND("Qty. to Assign" * "Unit Cost",Currency."Amount Rounding Precision");

The version we are working with is the North American NAV 2009SP1.
This problem also exists in Table 5809, "Item Charge Assignment (Sales)".
Now my question is, Is my license incorrect or did I found a small bug here?

Thank you,

Willy
Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.

Answers

  • ara3nara3n Member Posts: 9,256
    check and see if somebody has inserted a record into the currency table.

    If there is record, delete it with dev license.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • David_SingletonDavid_Singleton Member Posts: 5,479
    ANd make sure that developers NEVER use a developer license in a live environment. :whistle: :whistle: :whistle:
    David Singleton
  • KYDutchieKYDutchie Member Posts: 345
    Thanks guys,

    There were no records in the currency table, I made sure. Putting the If statement around the native code fixes the problem.
    I just hope that no more "bugs" exist. But that is what testing is for right?

    Thanks all.

    Regards,

    Willy

    PS,
    David.
    If one of our developers leaves our license anywhere on a customer's server, they will have an issue with me! :mrgreen:
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
Sign In or Register to comment.