[How-to] Display Currency Symbol in Amount [Microsoft Dynamics NAV]
Views (57)
Lets start course on how to Display Currency Symbol in Microsoft Dynamics NAV. Yes, it's possible.
The final output will be as per image below.
![]()
As highlighted done above, you can display currency symbol in Sales Document.
Let's create a new codeunit called Format Mgt. and save it as 50001. Create a new Global function called "ConstructCurrencyFormatString"
Let's deep down to this function. While calling this function, you will have to pass CurrencyCode and CurrencyFormat as parameter. If the document has no currency code, it will get the currency from the general ledger setup. You will have to define the currency symbol in Currency master.
Now, we are done with the main function, let's start calling this function in sales order subform.
Open page 46 in designer mode and define Global Variable for codeunit 50001. Also create new text variable called CurrencyFormat.
Inside OnAfterGetRecord trigger of page 46 call the function ConstructCurrencyFormatString as below.
After all this done, open the property of "Line Amount" field and modify the AutoFormatType and
AutoFormatExpr as below.
Now all done, start creating new sales order with different currencies, you will get the currency symbol in "Line Amount".
The final output will be as per image below.
As highlighted done above, you can display currency symbol in Sales Document.
Let's create a new codeunit called Format Mgt. and save it as 50001. Create a new Global function called "ConstructCurrencyFormatString"
PROCEDURE ConstructCurrencyFormatString@16(VAR CurrencyCode@1004 : Code[10];VAR CurrencyFormat@1003 : Text);
VAR
Currency@1002 : Record 4;
GLSetup@1001 : Record 98;
CurrencySymbol@1000 : Text[10];
BEGIN
IF CurrencyCode = '' THEN BEGIN
GLSetup.GET;
CurrencySymbol := GLSetup.GetCurrencySymbol;
END ELSE BEGIN
IF Currency.GET(CurrencyCode) THEN;
CurrencySymbol := Currency.GetCurrencySymbol;
END;
CurrencyFormat := STRSUBSTNO('%1<precision, 2:2><standard format, 0>',CurrencySymbol);
END;
Let's deep down to this function. While calling this function, you will have to pass CurrencyCode and CurrencyFormat as parameter. If the document has no currency code, it will get the currency from the general ledger setup. You will have to define the currency symbol in Currency master.
Now, we are done with the main function, let's start calling this function in sales order subform.
Open page 46 in designer mode and define Global Variable for codeunit 50001. Also create new text variable called CurrencyFormat.
FormatMgt@1027 : Codeunit 50010;
CurrencyFormat@1025 : Text
Inside OnAfterGetRecord trigger of page 46 call the function ConstructCurrencyFormatString as below.
FormatMgt.ConstructCurrencyFormatString("Currency Code",CurrencyFormat);
After all this done, open the property of "Line Amount" field and modify the AutoFormatType and
AutoFormatExpr as below.
AutoFormatType 10
AutoFormatExpr CurrencyFormat
Now open currency card and keep the currency symbol. Close RTC and reopen it again to take effect on formatting of decimals.Now all done, start creating new sales order with different currencies, you will get the currency symbol in "Line Amount".
This was originally posted here.
*This post is locked for comments