Dynamics 365 Business Central¶
Microsoft Dynamics 365 is a cloud-based business applications platform that combines components of customer relationship management (CRM) and enterprise resource planning (ERP). It was launched in 2016, when Microsoft combined Dynamics AX (its ERP application) with its Dynamics CRM application.
Dynamics 365 removes the divide between traditional ERP and CRM functionality into a unified, multi-functional application with specific business processes designed for Sales, Marketing, Finance, Customer Service, Field Service, Operations, Project management and more for all the roles and business units across your business.
As this results in many data, menus, views… that will be an arduous work to port all of them to Denodo. To make this process more friendly, you have available the Dynamics 365 wizard which allows you to access the following functionalities:
Finance
General journals
Chart Accounts
G/L Account Categories
Fixed Assets
Employees
Cash management
Bank Accounts
Bank Acc. Statements
Sales
Customers
Items
Sales Quotes
Sales Orders
Sales Invoices
Sales Credit Memos
Finance Charge Memos
Posted Sales Invoices
Posted Sales Credit Memos
Purchasing
Vendors
Purchase Quotes
Purchase Orders
Purchase Invoices
Purchase Credit Memos
Posted Purchase Invoices
Posted Purchase Credit Memos
For each one of the mentioned views, there will be a simplified one (only shows the fields already shown in the Dynamics 365 web interface) and a full one (shows all the fields of the entity). In some cases, there will be a view with the _lines suffix to see the line detail of invoices, orders, quotes…
Getting OAuth 2.0 Credentials¶
To get the parameters needed to authenticate to Dynamics 365, you need to follow these steps:
Log into https://portal.azure.com/ with your username and password.
Register an application in Azure Active Directory. Here is where you get the client id (Application ID).
App in Azure portal¶
Grant permissions to the app in API permissions > Add a permission. Select Dynamics CRM API and click in Delegated Permissions. Select user_impersonation and click Add permissions.
Setup client secret value in Certificates & secrets. Write it down since it will not be accessible again.
Token endpoint URL is in the Endpoints tab.
Auth. server URL would be like https://login.windows.net/<username>/oauth2/authorize?resource=https://api.businesscentral.dynamics.com. You also must include your username like you did in the earlier step.
You also need to configure the callback URL in Settings > Callback URL and set http://localhost:9090/oauth/2.0/redirectURL.jsp.
Now, you have all the data needed for the OAuth 2.0 Credentials wizard in Denodo:

OAuth wizard step 1¶
Once you have filled in the input fields of step one of this wizard, click Generate the authorization URL and a URL will be displayed just below the link. Open it in a browser and you will see something like this:

OAuth wizard step 2¶
Finally, you must copy that code and paste it in step 3 of the wizard and click in Obtain the OAuth 2.0 credentials. You can copy the credentials to the clipboard as you will need to use them later in the configuration process.

OAuth wizard step 3¶
Importing Artifacts¶
To create Dynamics 365 Business Central views, click the menu File > New > Data source and select Dynamics 365 Business Central.

Dynamics 365 Business Central wizard¶
Enter the following parameters:
Database. Name of the database in which the Dynamics 365 views will be created.
Company. You will find this value in the Companies section of Business Central. The value will be in the Name column of the companies list. Note that you may escape specials characters like blank spaces (CRONUS%20US, for example).
API version. the version you want to use of the Dynamics 365 API for Business Central. By default, it is set to v1.0.
Azure directory ID. Navigate in Azure through Azure active directory > Properties and you will see the value in Directory id.
Access token . OAuth 2.0 access token generated in the earlier section.
Refresh token. OAuth 2.0 refresh token generated in the earlier section.
Client ID. The client id from the newly created Azure application.
Client secret . The value of the secret generated in the earlier section for the newly created application.
Now, click Execute import to create the data sources and the views to query Dynamics 365.

Dynamics 365 Business Central views¶
Limitations¶
Dynamics 365 Business Central web services exposed There are a lot of entities involving Business Central, but out-of-the-box only a few of them have active endpoints to access them. Some have to be activated manually (described in Appendix II section), so you need to go to the Appendix I Accessing other entities to add it by yourself. Those steps are also valid for adding new entities not included here.
Insert operations Dynamics 365 Business Central reports some entities with non-nullable ID fields, so an insert operation will not work without specifying an ID value. But, in the source, that field is auto generated and causes an error when specified a value in an insert operation.
Business Central API version The current version of the Denodo Dynamics 365 Business Central wizard only supports version 1.0 of the Microsoft Business Central API. Using these templates with newer versions might result in partial support of existing entities and fields.
Appendix I: Accessing Other Entities¶
There are many entities involving Dynamics 365 Business Central and, out-of-the-box, there are only web services exposed to consume data for a few of them. So, some of them need to be activated manually. And you will have to follow these steps also if you need to access an entity not included in this wizard.
Expose the desired entity as a web service. Go to your Business Center web application account and press the search button. Then type “web services” in the displayed dialog to get the link to the WS list and click on it.
Expose an entity as a web service¶
Once you get there, just click the New button and type the entity name you want in the empty line displayed. Here you can see an example for the Employee Card entity:
Add new entity¶
EmployeeCard entity¶
After selecting the entity, you must enter a Service Name and select the Publishable check box. When saved, the application will show you the ODataV4 URL for the web service you have just created.
New entity added URL¶
Create the base view in Denodo VDP. Now that we have the web service, we can create a base view to access the data. So, go to Design Studio, open the ds_dynamics_365_bc data source created during the execution of the wizard and select Create base view.
Create base view¶
You will see a new dialog that you may fill as follows:
Entity collection: the collection defined in the OData service you want to access. In this example, we set up employeeCard.
Entity name: the name explained right before, it would be employeeCard in this example.
Click Create Base View and you will see your new base view.
Appendix II: List Of Endpoints For The Most Relevant Entities¶
As you have seen in Appendix I Accessing Other Entities, we had to search in the web services section of Business Central for the Employee Card endpoint, that matches the object Employee Card with the ID 5200.

Search Employee Card entity¶
Here is a list for the most relevant entities IDs with their endpoints disabled by default, so, you will only must follow the previous steps for each entity you want to add. Important, you must select Page on the Object type combo before opening the object selector. Use the service names described here when you add them to ensure everything is still working correctly:

Entities list¶