Posts

Showing posts from April, 2019

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 as Category. That

How to send email from a table in SQL Server

Image
Create a new table named  System Generated Email in SQL Server Database: CREATE TABLE [dbo].[B$System Generated Email]( [No] [int] NOT NULL, [To Address] [varchar](250) NOT NULL, [From Address] [varchar](100) NOT NULL, [From Address Title] [varchar](250) NOT NULL, [CC Address] [varchar](250) NOT NULL, [Email Subject] [varchar](MAX) NOT NULL, [Email Body] [varchar](MAX) NOT NULL, [Sent] [tinyint] NOT NULL, [Email Sending Date] [datetime] NOT NULL, [Email Sending Time] [datetime] NOT NULL, CONSTRAINT suppliers_pk PRIMARY KEY (No) ) This table will contains all system generated emails. Now we need to write a SQL Procedure which will create emails from  System Generated Email Table and send through the SQL email profile. Email profile can be found in Database Mail option: SQL code for sending Email: USE msdb GO DECLARE @email_id varchar(250), @from_mail varchar(250), @cc_mail va

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 from a Dot