Integrating with Dynamics 365 Sales

The sales person role is often considered as one the most outward-facing jobs in a business. However, it can be helpful for sales people to be able to look inward in the business and see what is happening on the back end. By integrating Dynamics 365 Sales. For example, when preparing a sales quote it could be useful to know whether you have enough inventory to fulfill the order. For more information, see Use Dynamics 365 Sales from Business Central.

[!NOTE] This topic describes the process of integrating the online versions of --- author: edupont04

ms.topic: include ms.date: 04/01/2021 ms.author: edupont

Dataverse. For information about on-premises configuration, see Preparing Dynamics 365 Sales for Integration on-premises.

Integrating Through Dataverse

To make it easy to connect and synchronize data with other Dynamics 365 applications, --- author: edupont04

ms.topic: include ms.date: 04/01/2021 ms.author: edupont

Dataverse. For more information, see Integration with Dataverse.

If you've already integrated --- author: edupont04

ms.topic: include ms.date: 04/01/2021 ms.author: edupont

Dataverse. For more information, see Upgrading an Integration with Dynamics 365 Sales.

[!NOTE] Reconnecting through --- author: edupont04

ms.topic: include ms.date: 04/01/2021 ms.author: edupont

Dataverse will apply default synchronization settings, and will overwrite any configurations you have. For example, the default table mappings will be applied.

Integration Settings that are Specific to a Dynamics 365 Sales Integration

Integration with Dynamics 365 Sales. The following sections list those settings.

Permissions and Security Roles for User Accounts in Sales

When you install the Integration Solution, permissions for the integration user account are configured. If those permissions are changed, you might need to reset them. You can do that by reinstalling the Integration Solution by choosing Redeploy Integration Solution on the Dynamics 365 Connection Setup page. The following security roles are deployed:

  • Dynamics 365 Business Central Integration Administrator
  • Dynamics 365 Business Central Integration User
  • Dynamics 365 Business Central Product Availability User

Connection Settings in the Setup Guide

You can use an assisted setup guide to quickly set up the connection and specify advanced features, such as coupling between records.

  1. Choose Setup and Extensions, and then choose Assisted Setup.
  2. Choose Set up the Dynamics 365 Sales Connection to start the assisted setup guide.
  3. Fill in the fields as necessary.
  4. Optionally, there are advanced settings that can enhance security and enable more capabilities. The following table describes the advanced settings.
Field Description
Import Dynamics 365 Sales Solution Install and configure the integration solution in Dynamics 365 Sales.
Automatically Synchronize Item Availability Specifies that the item availability job queue must be scheduled. The job queue runs every 30 minutes, and updates the availability of the coupled items.
Enable Sales Order Integration When people create sales orders in Dynamics 365 Sales. For more information, see Handling Sales Order Data.
Enable Dynamics 365 Sales Connection Enable the connection to Dynamics 365 Sales.
Dynamics 365 SDK Version This is relevant only if you're integrating with an on-premises version of Dynamics 365 Sales.

Connection Settings on the Microsoft Dynamics 365 Connection Setup Page

Enter the following information for the connection from Business Central.

Field Description
Dynamics 365 Sales URL The URL of your Business Central.
Automatically Synchronize Item Availability Specifies that the item availability job queue must be scheduled. The job queue runs every 30 minutes, and updates the availability of the coupled items.
Dynamics 365 SDK Version If you're integrating with an on-premises version of Dynamics 365 Sales.

In addition to the settings above, enter the following settings for Dynamics 365 Sales.

Field Description
Sales Order Integration is Enabled Enable users to submit sales orders and activated quotes in Dynamics 365 Sales. For more information, see Enable sales order processing integration.
Automatically Create Sales Orders Create a sales order in Dynamics 365 Sales.
Automatically Process Sales Quotes Process a sales quote in Dynamics 365 Sales. For more information, see Handling Sales Quotes Data.
Bidirectional Synch of Sales Orders Synchronize sales orders in both directions. For example, if a customer changes their mind about the product or quantity they ordered in Dynamics 365 Sales. Bidirectional synchronization helps keep your sellers up to date with the latest changes and the status of quotes and orders.

Standard Sales Entity Mapping for Synchronization

Entities in Dynamics 365 Sales.

The following table lists the standard mapping between tables in Business Central provides.

Dynamics 365 Sales Synchronization Direction Default Filter
Unit of Measure Unit Group Dynamics 365 Sales
Item Product Business Central Sales contact filter: Product Type is Sales Inventory
Resource Product Business Central Sales contact filter: Product Type is Services
Item Unit of Measure CRM UOM Dynamics 365 Sales
Resource Unit of Measure CRM UOM Dynamics 365 Sales
Unit Group CRM Uomschedule Dynamics 365 Sales
Customer Price Group Price List Dynamics 365 Sales
Sales Price Product Price List Business Central contact filter: Sales Code isn't blank, Sales Type is Customer Price Group
Opportunity Opportunity Business Central
Sales Invoice Header Invoice Dynamics 365 Sales
Sales Invoice Line Invoice Product Dynamics 365 Sales
Sales Order Header Sales Order Business Central Sales Header filter: Document Type is Order, Status is Released
Sales Order Notes Sales Order Notes Business Central

[!NOTE] The mappings for the Item Unit of Measure, Resource Unit of Measure, and Unit Group tables are available only if your administrator has turned on the Feature Update: Multiple Units of Measure Synchronization with Dynamics 365 Sales feature switch on the Feature Management page. For more information, see Synchronizing Items and Resources with Products in Different Units of Measure.

Synchronizing Items and Resources with Products with Different Units of Measure

Businesses often produce or purchase the items in one unit of measure, and then sell them in another. To synchronize items that use multiple units of measure, you must turn on the Feature Update: Multiple Units of Measure Synchronization with Dynamics 365 Sales feature switch on the Feature Management page.

When you turn on the feature update, a new Unit Group table is created and assigned to each item and resource in Dynamics 365 Sales. The following image shows the mappings.

You can create multiple units of measure for each unit group, and assign the groups to products in Dynamics 365 Sales.

Mapping Items and Resources to Products

When you turn on the Feature Update: Multiple Units of Measure Synchronization with Dynamics 365 Sales feature switch, the following happens:

  • New mappings are created for items and resources.
  • Existing mappings are deleted.
  • A data upgrade creates unit groups for items and resources.

To use the new mappings, you must synchronize unit groups, item unit of measure, and resource unit of measures. You must also resynchronize items and resources.

[!NOTE] Dynamics 365 Sales.

The following steps describe the steps to start mapping unit groups:

  1. Be sure that products in Business Central. If they are, go to the Items and/or Resources pages and use the filter options to select the coupled records. Then choose the Dynamics 365 Sales action, and select Uncouple. This action schedules a background job to uncouple the records. While the job is running, you can check its status by using the Synchronization Log action. For more information, see Coupling and Synchronizing.

  2. Because new products will be created in Dynamics 365 Sales with new unit groups, to avoid duplicate names, do one of the following steps:

    • Rename your products, and then retire them in Dynamics 365 Sales. For more information, see Retire products (Sales Hub). To bulk edit your products in Microsoft Excel, sign in to Power Apps, choose your environment, go to the Product table, and then choose the Data tab. Clear any filters that are applied. In the Data group, choose the Edit Data in Excel action. Add a prefix or suffix to the coupled products, and then retire them.
    • Retire your products and delete them.
  3. Follow these steps to synchronize Unit Groups, Unit of Measures, Items, and Resources:

    1. In Business Central, open the Dynamics 365 Sales Connection Setup page.
    2. Use the Run Full Synchronization action to open the Dataverse Full Synch. Review page.
    3. For the ITEM UOM, RESOURCE UOM, AND UNIT GROUP mappings, choose the Recommend Full Synchronization action.
    4. Choose the Sync All action.

    [!NOTE] For mappings that have not yet been fully synchronized, this action will fully synchronize them. To prevent those mappings from synchronizing, delete the mappings from the page. This only removes them from the current full synchronization, and does not delete the mappings.

  4. Choose the ITEM-PRODUCT mapping, and then choose the Restart action. Restarting creates new products from the items in Dynamics 365 Sales, and assigns a new unit group that is specific to the item.

  5. Choose the RESOURCE-PRODUCT mapping, and then choose the Restart action. Restarting creates new products from the resources in Dynamics 365 Sales, and assigns a new unit group that is specific to the resources.

Synchronization Rules

The following table lists the rules that control the synchronization between Business Central. These rules are in addition to rules defined for Dataverse, which also apply. For more information, see Standard Entity Mapping.

[!NOTE]
Changes to data in that were made by the integration user account are not synchronized. Therefore, we recommended that you do not change data while using that account. For more information, see Setting Up User Accounts for Integrating with Dynamics 365 Sales.

Table Rule
Units of Measure Units of measure are synchronized with unit groups in Dynamics 365 Sales. There can only be one unit of measure defined in the unit group.
Items When synchronizing items with Dynamics 365 Sales. To avoid synchronization errors, you shouldn't modify this price list manually.
Resources Resources are synchronized with Dynamics 365 Sales products that have product type Service.
Customer Price Groups Customer price groups are synchronized with Sales price lists.
Sales Prices Sales prices that have sales type Customer Price Group and have a sales code defined are synchronized with Dynamics 365 Sales price list lines
Opportunities Opportunities are synchronized with Dynamics 365 Sales.
Posted Sales Invoices Posted sales invoices are synchronized with sales invoices. Before an invoice can be synchronized, it's better to synchronize all other tables that can participate in the invoice, from salespersons to price lists. The Salesperson Code value in the invoice header defines the owner of the coupled table in Sales.
Sales Orders When sales order integration is enabled, sales orders in Dynamics 365 Sales.

Synchronization Jobs for a Sales Integration

The jobs are run in the following order to avoid coupling dependencies between tables. There are more jobs available from Dataverse. For more information, see Use Job Queues to Schedule Tasks.

  1. UNITOFMEASURE - Dynamics 365 Sales synchronization job
  2. RESOURCE-PRODUCT - Dynamics 365 Sales synchronization job
  3. ITEM-PRODUCT - Dynamics 365 Sales synchronization job
  4. CUSTPRCGRP-PRICE - Dynamics 365 Sales synchronization job.
  5. SALESPRC-PRODPRICE - Dynamics 365 Sales synchronization job.
  6. POSTEDSALESINV-INV - Dynamics 365 Sales synchronization job.

Default Synchronization Job Queue Entries

The following table describes the default synchronization jobs for Sales.

Job Queue Entry Description Direction Integration Table Mapping Default Synchronization Frequency (mins) Default inactivity sleep time (mins)
UNITOFMEASURE - Dynamics 365 Sales synchronization job Synchronizes Dynamics 365 Sales UNIT OF MEASURE 30 720
(12 hrs)
RESOURCE-PRODUCT - Dynamics 365 Sales synchronization job Synchronizes Dynamics 365 Sales RESOURCE-PRODUCT 30 720
(12 hrs)
ITEM - PRODUCT - Dynamics 365 Sales synchronization job Synchronizes Dynamics 365 Sales ITEM-PRODUCT 30 1440
(24 hrs)
CUSTPRCGRP-PRICE - Dynamics 365 Sales synchronization job Synchronizes Business Central customer price groups. CUSTOMER PRICE GROUPS-SALES PRICE LISTS 30 1440
(24 hrs)
SALESPRC-PRODUCTPRICE - Dynamics 365 Sales synchronization job Synchronizes Business Central sales prices. PRODUCT PRICE-SALES PRICE 30 1440
(24 hrs)
POSTEDSALESINV-INV - Dynamics 365 Sales synchronization job Synchronizes Dynamics 365 Sales INVOICES-POSTED SALES INVOICES 30 1440
(24 hrs)
Customer Statistics - Dynamics 365 Sales synchronization Updates Dynamics 365 Sales. Not applicable Not applicable 30 Not applicable

Connecting to On-Premises Versions of Business Central 2019 release wave 1 and Microsoft Dynamics NAV 2018

The Microsoft Power Platform team has announced that it's deprecating the Office365 authentication type. If you're using a version of Dynamics 365 Sales online. The steps in this section describe how to connect the following product versions:

  • Business Central 2019 release wave 1
  • Microsoft Dynamics NAV 2018

Prerequisites

To connect Business Central 2019 release wave 1 and Dynamics NAV 2018

  1. Import the Microsoft Dynamics 365 Business Central Integration Solution into your Business Central or Dynamics NAV 2018 installation DVD. Depending on your product version, import one of the following solutions:

    • For Dynamics 365 Sales online requires the DynamicsNAVIntegrationSolution_v91 integration solution.
    • For Dynamics NAV 2018, install the DynamicsNAVIntegrationSolution solution.
  2. Create a non-interactive integration user in your Dynamics 365 Sales environment, and assign the user the following security roles. For more information, see Create a non-interactive user account.

    • Dynamics 365 Business Central Integration Administrator
    • Dynamics 365 Business Central Integration User

    [!Important] This user must not have the System Administrator security role. Also, you cannot use the system administrator account as the integration user.

  3. In the Azure portal, create an app registration for Business Central. For more information, see Register an application in Azure Active Directory.

[!NOTE] We recommend that you register the app in the same tenant as your Dataverse environment so that you do not have to consent to letting the app access the environment. If you register the app in another environment, you must sign in to Azure AD using the administrator account for your Dataverse environment and give consent.

Additionally, the app that you register must not have a secret. Connecting an app with a secret to Dataverse is available only in Business Central 2020 release wave 1 and later.

  1. Depending on your product version, do one of the following steps:

    • In Business Central, search for Microsoft Dynamics 365 Connection Setup, and then choose the related link.
    • In Dynamics NAV 2018, search for Microsoft Dynamics 365 for Sales Connection Setup, and then choose the related link.
  2. In the Authentication Type field, choose the option for OAuth.

  3. Choose the CRM SDK version that matches solution version you imported in step 1.

    [!NOTE] This step is only relevant for Business Central.

  4. Enter the URL of your Dynamics 365 Sales environment, and then enter the user name and password for the integration user.

    • In Business Central, use the Server Address field.
    • In Dynamics NAV 2018, use the Dynamics 365 Sales URL field.
  5. In the Connection String field, specify the ID of the app registration. This field has two tokens in which the ID of your application should be specified.

    Token Description
    AppId Set to the application ID.
    RedirectUri Set to the application ID, but add the app:// prefix.

    Example The following example shows a connection string.

    AuthType=OAuth;Username=jsmith@contoso.onmicrosoft.com;Password=****;Url=https://contosotest.crm.dynamics.com;AppId=<your AppId>;RedirectUri=app://<your AppId>;TokenCacheStorePath=;LoginPrompt=Auto
    
  6. Enable the connection.

[!Note] If you want to configure a connection to a Business Central.

See Also

Setting Up User Accounts for Integrating with Dynamics 365 Sales
Set Up a Connection to Dynamics 365 Sales
Synchronizing Business Central and Dynamics 365 Sales
Preparing Dynamics 365 Sales for Integration on-premises

--- author: edupont04

ms.topic: include ms.date: 12/20/2021 ms.author: edupont

Business Central on Microsoft Learn