Posts

Showing posts from August, 2023

How to Implement Interface in Business Central

Image
                                          With the release of Business Central Wave 1 2020 new feature was introduced called ‘Interface’. It is basically syntactical contract that can be implemented by a non-abstract method. This allows for writing code that reduces the dependency on implementation details, makes it easier to reuse code. Today we will see how to write an interface and implement in Business central.   Note : With Business Central 2023 release wave 1, you can use the Go to Implementations option in the Visual Studio Code context menu (or press Ctrl+F12) on an interface to view all the implementations within scope for that interface. This is supported on interfaces, and on codeunits and enums, which implement an interface, as well as on their procedures if they map to a procedure on an interface. It's also supported on codeunit variables of type interface to jump t...

How To Connect An External Database To Business Central

Image
  In this post I would like to share the way you can connect an external SQL Server database to Business Central. This way you can check historic data from an older versions of Nav. Retrieve data from other databases and work with them as if you had a Business Central table. Create the table to connect First of all, we need to create a table in Business Central. As an example, we will connect to an older version of Nav and get the customers from the database. The table type will be ‘ExternalSQL’ and the external name will be the same that it´s in SQL Server (Company Name + Table Name + App ID). Add the fields you wish to retrieve from the Sql table. An example of a table would look like this. Note that if there is no primary key, BC will assign it to the first field. Then, if you will login with Windows authentication or username and password. With this information create the connection string: //Windows Authentication: 'Data Source=<DatabaseServer>\<DatabaseServer...

How can see business central extension fields in Sql Server by using Joins

Image
 Step 1: Create a new extension for a new field in customer. Step 2: Add a field on the customer card page as below.            if we create an extension in Business Central, the backend of the SQL server will create a separate table for the extension.  Here we can see the project app ID and some details SQL SELECT Statement for Inner Join To specify an inner join with an SQL statement, you can do either of the following: Use a WHERE clause. Use the INNER JOIN condition with an ON clause. The following example shows how to create an inner join on the No and customer & customer extension tables with SQL statements.  Result dataset: here customer 10000 is selected as the payment method is cash    Please let me know your views and add your questions in the comments of this article. Thanks & Regards SRK.A