10 Sep’17

D365 Business CentralProcedure to display the Amount in Words in a report of Microsoft Dynamics NAV

Introduction:

In this article, I will be explaining the procedure to display amount in words in a report of Microsoft Dynamics NAV.

Pre-Requisite:

Microsoft Dynamics NAV 2016

Procedure:

Step 1:
Declare the following variables in C/AL Globals:

  1. RepCheck’ is a variable of DataType ‘Report’ and Subtype ‘Check’ which is Report 1401.
  2. NoText’ is a variable of DataType ‘Text’ with Dimensions Value as 2 which is set by navigating to the properties of the ‘NoText’ variable.
  3. AmountInWords’ is a variable of DataType ‘Text’ which will store the final result of the amount in words.

Step 2:
Now in my custom purchase order report, I want to display the Amount to Vendor in Words.

So in the Purchase Header – OnAfterGetRecord() trigger, I have put the following code:

I have declared a variable ‘AmountVendor’ of DataType ‘Decimal’ in which I will be storing the ‘Amount to Vendor’. I have rounded off the Amount to 2 decimal places.

AmountVendor:= ROUND("Purchase Header"."Amount to Vendor",0.01);

Now add the following code to display the Amount in Words:

RepCheck.InitTextVariable;

RepCheck.FormatNoText(NoText,AmountVendor,"Purchase Header"."Currency Code");

AmountInWords:=NoText[1];

So the complete code looks like below:

Step 3:
Now get the variable ‘AmountInWords’ under the DataSource ‘Purchase Header’ in the report and display it in the design layout of the report.

After saving and running the report the Amount to Vendor will be displayed in Words as shown below:

Conclusion:

Thus using the above procedure and the Report 1401 i.e. ‘Check’ report, the amount in words can be easily displayed in any report of Microsoft Dynamics NAV 2016.

 

Written by

Team Member

CloudFronts

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more