web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to implement strong Contact integration between BC and Dataverse

(5) ShareShare
ReportReport
Posted on by 14
Hi,
my scenario:
D365 BC 20 On-Premise
Dataverse/Dynamics 365 Sales Online
D365 BC is integrated with Dataverse using data-sync hybrid Dataverse Connection Setup. (Standard native data-sync connector)
In BC23.5 and previous versions, we cannot add new integration tables other than the default tables. We need to go through complex AL customizations.
 
 
I am trying to create this custom scenario:
  1. I want to create standalone code and prevent the automatic creation of Microsoft default records in the 'Integration Table Mapping' (5335) table. My goal is to have only my custom records appear when clicking 'Use Default Synchronization Setup';
  2. Contacts created in Business Central must be imported into Dataverse and can only be updated from Business Central;
  3. Contacts created in Dataverse must be imported into Business Central and can only be updated from Dataverse.
 
The guidelines posted in the official microsoft documentation (Customizing an integration with Microsoft Dataverse) do not help me achieve these objectives.
However, I'm not sure if it's enough to use one-direction way (from/to integration) or two way direction (bidirectional)...
 
Could someone suugest me any compatible integration logic, please?
Could someone provide me any AL code sample, please?
Could someone help me, please?
 
Thanks!
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,554 Super User 2026 Season 1 on at
    Good morning, afternoon, or evening depending on your location :)
    Hope you are well today!
     
    Based on the latest Microsoft documentation and your scenario (BC 20 On-Premise with hybrid Dataverse sync), here’s a tailored approach to implement custom Contact integration between Business Central (BC) and Dataverse, while avoiding default mappings and enforcing one-way sync rules:
     
    Your Goals Recap
    1. Custom integration only – no default mappings in table 5335 (Integration Table Mapping).
    2. One-way sync:
      • BC → Dataverse: Contacts created in BC sync to Dataverse, only updated in BC.
      • Dataverse → BC: Contacts created in Dataverse sync to BC, only updated in Dataverse.
     
    Recommended Integration Logic
    1. Prevent Default Mappings
    To avoid default records in Integration Table Mapping when using "Use Default Synchronization Setup":
    • Override the event OnAddEntityTableMapping in codeunit CRM Setup Defaults (5334).
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"CRM Setup Defaults", 'OnAddEntityTableMapping', '', false, false)]
    local procedure SkipDefaultMappings(var IntegrationTableMapping: Record "Integration Table Mapping"; var Handled: Boolean)
    begin
        Handled := true; // Prevents default mappings from being added
    end;

    2. Create Custom Integration Table for Contact
    Use the AL Table Proxy Generator (altpgen.exe) to generate a proxy table for the Dataverse Contact entity.
    altpgen.exe -project:"<YourProjectPath>" -packagecachepath:"<YourCachePath>" -serviceuri:"<DataverseURL>" -clientid:"<ClientID>" -redirecturi:"<RedirectURI>" -entities:contact -baseid:50000
     
    This generates a table like:
    table 50000 "Dataverse Contact"
    {
        TableType = CDS;
        // Fields from Dataverse Contact entity
    }

    3. Create Custom Integration Table Mapping
    Manually insert your custom mapping into Integration Table Mapping (5335) via AL or setup codeunit:
    IntegrationTableMapping.Init();
    IntegrationTableMapping."Table ID" := DATABASE::Contact;
    IntegrationTableMapping."Integration Table ID" := DATABASE::"Dataverse Contact";
    IntegrationTableMapping.Direction := IntegrationDirection::ToIntegration; // or FromIntegration
    IntegrationTableMapping.Insert();

     
    Use ToIntegration for BC → Dataverse and FromIntegration for Dataverse → BC.
     
    4. Control Sync Direction
    Use the Direction field in Integration Table Mapping:
    • BC → Dataverse: ToIntegration
    • Dataverse → BC: FromIntegration
    This ensures updates only flow in one direction.
     
    5. Coupling Logic
    Use CRM Integration Management codeunit to manage coupling manually. You can create a page to allow users to couple records explicitly.
     
    6. Field Mapping
    Use Integration Field Mapping table to define which fields sync. You can also use transformation rules here to handle formatting or value differences.
     
    Testing Tips
    • Use a sandbox environment.
    • Test sync in both directions with filters applied.
    • Monitor Integration Sync Job and Integration Sync Error tables for issues.
     
    References  
    Note: I collaborated with Copilot to help craft this response for clarity and completeness.
    Hope this helps some!
  • Suggested answer
    YUN ZHU Profile Picture
    99,086 Super User 2026 Season 1 on at
    Hi, hope the following can give you some hints.
    Dynamics 365 Business Central Blog Series: Integrate with Microsoft Dataverse
     
    Thanks.
    ZHU
  • Suggested answer
    Tech-Lucky Profile Picture
    1,271 Moderator on at

    To achieve this, you must implement custom actions for synchronization and completely avoid using standard actions or code paths. Overriding the default synchronization logic is not straightforward, as the system triggers built-in events tied to the Dataverse Connection Setup and Integration Table Mapping for standard tables. These system events are automatically invoked, making it difficult to bypass them selectively.

    A more reliable approach is to create custom integration tables and manage synchronization through your own code. By populating these custom tables and handling the sync logic manually, you can fully bypass the standard event triggers and gain complete control over the data flow between Business Central and Dataverse.

  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,805 Super User 2026 Season 1 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans