Share via


Introduction to Dynamics 365 for Sales Integration Customization in Dynamics NAV

This topic provides an overview about customizing Microsoft Dynamics 365 for Sales integration in Dynamics NAV. When the integration is made, you can perform various sales and marketing tasks across the two products. For more information, see Managing Customers and Sales Created in Dynamics 365 for Sales in the application help.

Integration Objects

The following table describes the main objects in the Dynamics NAV database that are related to customizing Microsoft Dynamics 365 for Sales integration.

Object Description
Integration table Table that represents an entity in Microsoft Dynamics 365 for Sales. The integration table includes fields that correspond to fields in the entity. The integration table acts as a link or connector between the Dynamics NAV table and the Microsoft Dynamics 365 for Sales entity. For example, for integrating the Microsoft Dynamics 365 for Sales accounts entity, the Dynamics NAV database includes the CRM Accounts integration table. There must be an integration table for each Microsoft Dynamics 365 for Sales entity that you want to integrate in Dynamics NAV.

You create an integration table by using the New-NAVCrmTable in the Microsoft Dynamics NAV Development Shell.
Business data table Table for Dynamics NAV record type that will integrate with the Microsoft Dynamics 365 for Sales entity. For example, to integrate with the Microsoft Dynamics 365 for Sales Campaign entity, this would be the Campaign table.
Integration Table Mappings table Contains the integration table mappings that link the business data table to the integration table for the Microsoft Dynamics 365 for Sales entity. For each entity in Microsoft Dynamics 365 for Sales that you want to synchronize with data in Dynamics NAV, there must be a corresponding integration table mapping.
Integration Field Mappings table Contains the integration field mappings that associate fields in Microsoft Dynamics 365 for Sales entity record with fields in a Dynamics NAV record. The mapping is used to determine which data to synchronize between Microsoft Dynamics 365 for Sales and Dynamics NAV records. The field mappings define which field in Dynamics NAV corresponds to which field in Microsoft Dynamics 365 for Sales.
Coupling page Provides the user interface that enables users to couple a Dynamics NAV record to a Microsoft Dynamics 365 for Sales record. To integrate any Microsoft Dynamics 365 for Sales entity record with a Dynamics NAV record the two records must be coupled. The default Microsoft Dynamics 365 for Sales integration includes several coupling pages, such as the CRM Coupling Customer and CRM Coupling Contact pages. You can create your own coupling page from scratch or use one of the existing coupling pages as a starting point.
Integration Management codeunit Contains logic that controls the integration between Microsoft Dynamics 365 for Sales and Dynamics NAV. For example, to integrate a Dynamics NAV table with Microsoft Dynamics 365 for Sales entity, the table must be registered as an integration record in the codeunit.
CRM Coupling Management** codeunit Controls the coupling between Microsoft Dynamics 365 for Sales records and Dynamics NAV records.
CRM Setup Defaults codeunit Controls the default Microsoft Dynamics 365 for Sales integration setup. For example, in order to be included in the default Microsoft Dynamics 365 for Sales setup, an integration table mapping must be is registered in this codeunit.
CRM Integration Table Synch. codeunit Contains complex table mappings and synchronization rules.

Getting Started

The following list outlines the typical tasks required to integrate a Microsoft Dynamics 365 for Sales entity and a Dynamics NAV table (record type). For step-by-step procedures for each of these tasks, see Walkthrough: Customizing Microsoft Dynamics 365 for Sales Integration in Dynamics NAV.

  1. Create an integration table for the Microsoft Dynamics 365 for Sales entity.

    Use the New-NAVCrmTable cmdlet in the Microsoft Dynamics NAV Development Shell to create the table in your Dynamics NAV database.

  2. Create a list page that uses the integration table as its source.

    This page can be used to display a list of all records in the Microsoft Dynamics 365 for Sales entity. You can then use this page in your coupling page to enable users to select which Microsoft Dynamics 365 for Sales record to couple to the Dynamics NAV record.

  3. Enable the coupling of Microsoft Dynamics 365 for Sales entity records and Dynamics NAV records.

    1. Modify the Integration Management codeunit to enable integration records on the Dynamics NAV business data table that will integrate with the Microsoft Dynamics 365 for Sales entity.

    2. Create a coupling page that end-users can use to couple Microsoft Dynamics 365 for Sales records and Dynamics NAV records.

      You can base the new page on an existing coupling page.

    3. Add an action on the list page and card page for the Dynamics NAV records that links to the new coupling page.

    4. Modify the CRM Coupling Management codeunit to include a function for handling the coupling of Microsoft Dynamics 365 for Sales records and Dynamics NAV.

    5. Add an action on the list page and card page for the Dynamics NAV records that lets users open coupled records in Microsoft Dynamics 365 for Sales.

    6. Modify the CRM Setup Defaults codeunit.

      Add code to the GetTableIDCRMEntityNameMapping function to register the integration table and the business data table.

  4. Add an integration table mapping for the Microsoft Dynamics 365 for Sales entity and the Dynamics NAV business table.

    You can do this by modifying the Integration Table Mapping table directly or by modifying the CRM Setup Defaults codeunit.

  5. Add integration field mappings to map fields of the Microsoft Dynamics 365 for Sales entity and the Dynamics NAV business data table.

    For each integration table mapping entry, there must be one or more an integration field mappings to map the individual fields of the records in the business table and integration table. You only have to map the fields that you want synchronized.

    You can do this by modifying the Integration Field Mapping table or by modifying the CRM Setup Defaults table.

  6. Add an action on the list page and card page for the Dynamics NAV records that lets users synchronize data between coupled records.

    To achieve this, you will add code to the action that calls the CRM Integration Management codeunit.

  7. Use events to customize the synchronization process.

    Certain events are published and raised by the CRM Integration Table Synch. codeunit. You can add code that subscribes to these events and runs code when the events are raised. This enables you to add custom logic at different stages of the synchronization process.

See Also

Customizing Dynamics 365 for Sales and Dynamics NAV Integration
Events in Microsoft Dynamics NAV