Compartir a través de


Introduction to Dynamics CRM Integration Customization in Dynamics NAV

This topic provides an overview about customizing Microsoft Dynamics CRM integration in Microsoft Dynamics NAV.

Integration Objects

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

Object Description

Integration table

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

You create an integration table by using the New-NAVCrmTable in the Microsoft Dynamics NAV 2016 Development Shell.

Business data table

Table for Microsoft Dynamics NAV record type that will integrate with the Microsoft Dynamics CRM entity. For example, to integrate with the Microsoft Dynamics CRM Campaign entity, this would be the table 5071 Campaign.

Table 5335 Integration Table Mapping

Contains the integration table mappings that link the business data table to the integration table for the Microsoft Dynamics CRM entity. For each entity in Microsoft Dynamics CRM that you want to synchronize with data in Microsoft Dynamics NAV, there must be a corresponding integration table mapping.

Table 5336 Integration Table Mapping

Contains the integration field mappings that associate fields in Microsoft Dynamics CRM entity record with fields in a Microsoft Dynamics NAV record. The mapping is used to determine which data to synchronize between Microsoft Dynamics CRM and Microsoft Dynamics NAV records. The field mappings define which field in Microsoft Dynamics NAV corresponds to which field in Microsoft Dynamics CRM.

Coupling page

Provides the user interface that enables users to couple a Microsoft Dynamics NAV record to a Microsoft Dynamics CRM record. To integrate any Microsoft Dynamics CRM entity record with a Microsoft Dynamics NAV record the two records must be coupled. The default Microsoft Dynamics CRM integration includes several coupling pages, such as page 5241 Microsoft Dynamics CRM Account Coupling and 5242 Microsoft Dynamics CRM Contact Coupling. You can create your own coupling page from scratch or use one of the existing coupling pages as a starting point.

Codeunit 5150 Integration Management

Contains logic that controls the integration between Microsoft Dynamics CRM and Microsoft Dynamics NAV. For example, to integrate a Microsoft Dynamics NAV table with Microsoft Dynamics CRM entity, the table must be registered as an integration record in the codeunit.

Codeunit 5331 CRM Coupling Management

Controls the coupling between Microsoft Dynamics CRM records and Microsoft Dynamics NAV records.

Codeunit 5334 CRM Setup Defaults

Controls the default Microsoft Dynamics CRM integration setup. For example, in order to be included in the default Microsoft Dynamics CRM setup, an integration table mapping must be is registered in this codeunit.

Codeunit 5340 CRM Integration Table Synch.

Contains complex table mappings and synchronization rules.

Getting Started

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

  1. Create an integration table for the Microsoft Dynamics CRM entity.

    Use the New-NAVCrmTable cmdlet in the Microsoft Dynamics NAV 2016 Development Shell to create the table in your Microsoft 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 CRM entity. You can then use this page in your coupling page to enable users to select which Microsoft Dynamics CRM record to couple to the Microsoft Dynamics NAV record.

  3. Enable the coupling of Microsoft Dynamics CRM entity records and Microsoft Dynamics NAV records.

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

    2. Create a coupling page that end-users can use to couple Microsoft Dynamics CRM records and Microsoft 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 Microsoft Dynamics NAV records that links to the new coupling page.

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

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

    6. Modify codeunit 5334 CRM Setup Defaults.

      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 CRM entity and the Microsoft Dynamics NAV business table.

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

  5. Add integration field mappings to map fields of the Microsoft Dynamics CRM entity and the Microsoft 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 table 5336 Integration Field Mapping or by modifying codeunit 5334 CRM Setup Defaults.

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

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

  7. Use events to customize the synchronization process.

    Certain events are published and raised by codeunit 5335 CRM Integration Table Synch.. 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

Concepts

Customizing Dynamics CRM and Dynamics NAV Integration
Events in Microsoft Dynamics NAV