Skip to main content

Notifications

Business Central forum
Answered

When Customer synchronize to Account in Dataverse, how primary key matches?

Posted on by 190

Hi there,

When Customer table sync into Dataverse, Customer uses its 'No.' field as primary key and generates a 'account_id' field as primary key in Dataverse.

But just wonder how it get mapped? Because 'No.' field is BC is a string, but account_id in Dataverse is a GUID, how can I match them manually?

Categories:
  • Ming Chen Profile Picture
    Ming Chen 190 on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    Appreciate for your help. I will do some test in system.

  • Suggested answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    I have not tried that, but I would expect you could do this with "CRM Integration Record". It might work with "CRM Account"/"CRM Contact"/etc. too--but I'm not sure. Certainly worth a try.

    Keep in mind that "CRM Account" and "CRM Integration Record" are 2 separate tables.

    "CRM Account" is strictly definition only--it's not a table in the SQL DB. So if you use ?table=xxx to view this table, it will be making calls to CRM in order to get/show you data.

    "CRM Integration Record" holds the CRM ID and a few other bits of information--for EVERY CRM record that you have an Table Mapping for.

  • Ming Chen Profile Picture
    Ming Chen 190 on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    Thank you Greg for the detailed reply.

    A quick questions, is it possible to use ?table=xxx to view the CRM integration table? for example the Account table?

  • Verified answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    BC uses 2 tables to link records: "Integration Record" and "CRM Integration Record".

    The field "Integration ID" is in both tables and is the link.

    So when an "Integration Record" and a "CRM Integration Record" become "coupled" they will have the same "Integration ID".

    Note that the "CRM Integration Record" is the only place where CRM data is physically stored in the BC database--besides data shared between coupled records. As yzhums said... All the "CRM <entity>" tables are "CDS" type tables and do not actually store data in the BC database. They simply provide a definition of the CRM table so that we can use the CRM table in AL code.

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 71,066 Super User 2024 Season 2 on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    Hi, This is because they are not directly related, and there is a table with TableType = CDS in the middle.

    pastedimage1645403439106v1.png

    I recommend you can try to create a new table and integrate with Dataverse. This way you can understand the logic well.

    More details: https://yzhums.com/17065/

    Hope this will help.

    Thanks.

    ZHU

  • Verified answer
    raelhefn Profile Picture
    raelhefn on at
    RE: When Customer synchronize to Account in Dataverse, how primary key matches?

    Hi,

    Please take a look at this document : docs.microsoft.com/.../admin-how-to-modify-table-mappings-for-synchronization

    An integration table is a table in the Business Central database that represents an table, such as an account, in Dataverse. Integration tables include fields that correspond to columns in the Dataverse table. For example, the Account integration table connects to the Accounts table in Dataverse. There must be a integration table mapping for each table in CDS that you want to synchronize with data in Business Central.

    When you create the connection between the apps, Business Central sets up some default mappings. You can change the table mappings if you want. For more information, see Standard Table Mapping for Synchronization. If you have changed the default mappings and want to revert your changes, on the Integration Table Mappings page, choose Use Default Synchronization Setup.

    If you are using an on-premises version of Business Central, the integration table mappings are stored in table 5335 Integration Table Mappings, where you can view and edit the mappings. Complex mappings and synchronization rules are defined in codeunit 5341.

    Mapping tables is only the first step. You must also map the fields on the tables. Integration field mappings link fields in Business Central tables with corresponding columns in Dataverse, and determine whether to synchronize data in each table. The standard table mapping that Business Central provides includes field mappings, but you can change those if you want. For more information, see Viewing Table Mappings.

    If you are using an on-premises version of Business Central, integration field mappings are defined in table 5336 Integration Field Mapping.

    You can manually map the fields, or you can automate the process by mapping multiple fields at the same time based on criteria for matching their values. For more information, see To couple multiple records based on field value matching.

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

News and Announcements

Forum Structure Changes Coming Soon!

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,712 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans