Posts

Showing posts with the label NAV

How to find the difference between two dates and return the corresponding number of months in Dynamics NAV

Image
You could use a variable Calendar > Record > Date IF ( FromDate <> 0D ) and ( ToDate > FromDate ) THEN BEGIN Calendar . RESET ; Calendar . SETRANGE ( "Period Type" , Calendar . "Period Type" :: Month ); Calendar . SETRANGE ( "Period Start" , FromDate , ToDate ); Months := Calendar . COUNT ; END ELSE Months := 0 ; The problem with this type of code is 01 Jan 07 to 01 Feb 07 will return 2 Months. When it is only 1 month 1 day! 31/01/06 and 01/02/06 will be 1 month between 01/01/06 and 28/02/06 will be 2 Months Date Difference in months.

How to design graphical RDLC report in Microsoft dynamics NAV 2018

Image
First we need to create a table for the graphical report. Lets create a new table which will contain budget and actual amount of different accounts with the following fields: Save the table as  Graphical Report Table. Now  i nsert following data into the table for example: Our table is ready for the Report. Now go to report section and click new to create a new report. In the report designer enter the table number or name as DataItem. Then select the table fields under the DataItem. Now select  View > Layout from main menu. The report layout will be open in visual studio. (If visual studio is not installed in your computer SQL report designer may open but I recomand Visual Studio for RDLC report design). in the visual studio report design choose chart from toolbox menu. Then create a chart you want from the list. Here i choose the first one for this example. In the chart data section select Actual and Budget field Sum in Value section. And Name...

Microsoft Dynamics NAV - Creating and Consuming a Codeunit Web Service

Image
We can create any code unit in Dynamics NAV and publish it as web-service. To do that we need to go to the page (form in 2009)  "Web Services".  In the Web Services page, choose New. In the Object Type column, select Codeunit, then in the Object ID column enter the Codeunit Number, and then enter a name in the Service Name column. This name will be the web-service name to consume.  Mark the check box in the Published column and choose OK to close the New - Web Services page. Webservice Form (2009) Verifying the Web services availability. Make sure flowing services are running in server. In Browser write the service URL to check if the service published successfully, Change the localhost with ip for remote server : http://localhost:7047/DynamicsNAV/WS/Services  If everything is ok you should see the published services names in the browser. Now lets try to consume the service. In this example we will see how to consume the service fr...