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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Business Central / Dataverse Integration - Custom Fields

(0) ShareShare
ReportReport
Posted on by 26

I'm attempting to synch custom fields in Business Central with custom fields in the Dataverse used by D365 for Sales. I'm able to create the custom fields using AL code in BC and customizations in D365. I'm also able to create new Integration Field Mapping records in the Integration Table Mapping area for Customers.

I followed these articles to get me this far:

Customizing an Integration with Microsoft Dataverse - Business Central | Microsoft Docs

Using AL Table Proxy Generator Tool to create Integration Table(s) in Business Central for the Dataverse table – ARKSD Consultancy Private Limited

 

Below is a code snippet of 2 fields I want to create an integration field mapping record for:

 

InsertIntegrationFieldMapping(

        IntegrationTableMappingName,

        Customer.FieldNo("Chapter"),

        CDSAccount.FieldNo("new_chapter"),

        IntegrationFieldMapping.Direction::FromIntegrationTable, '', true, false);

 

InsertIntegrationFieldMapping(

        IntegrationTableMappingName,

        Customer.FieldNo("Category"),

        CDSAccount.FieldNo("AccountCategoryCode"),

        IntegrationFieldMapping.Direction::FromIntegrationTable, '', true, false);

 

The procedure called by these 2 field mappings is this –

 

procedure InsertIntegrationFieldMapping(IntegrationTableMappingName: Code[20]; TableFieldNo: Integer; IntegrationTableFieldNo: Integer; SynchDirection: Option; ConstValue: Text; ValidateField: Boolean; ValidateIntegrationTableField: Boolean)

    var

        IntegrationFieldMapping: Record "Integration Field Mapping";

    begin

        IntegrationFieldMapping.CreateRecord(IntegrationTableMappingName, TableFieldNo, IntegrationTableFieldNo, SynchDirection,

            ConstValue, ValidateField, ValidateIntegrationTableField);

    end;

  

Both of the field mappings get created in the integration mapping table but a problem occurs with the “Chapter” field.

If I just create “Category” mapping a custom BC field (Category) with an out-of-the-box D365 field (AccountCategoryCode), I am able to couple a Customer/Account pair and sync data.

 fieldmapping1.png

If I also create the “Chapter” mapping a custom BC field (Chapter) with a custom D365 field (new_chapter), I am NOT able to couple Customer/Account records and sync.

 fieldmapping2.png

couplingerror.png

I am including some snapshots of what the mapping table looks like with just Category created and with both Category and Chapter created and an error message that is displayed when attempting to couple. One thing I noticed is that the Integration Field Name is blank for Chapter but does show an Integration Table Field No. of 10019 which was generated with the AL Table Proxy Generator tool. Below is the entry in the generated file.

 

field(10019;new_Chapter;Text[20])

    {

      ExternalName = 'new_chapter';

      ExternalType = 'String';

      Description = 'This is a chapter field';

      Caption = 'Chapter';

    }

 

It appears the custom D365 (DataVerse) field does not exist or cannot be resolved but the generator tool clearly sees the field and added to the file so that I could reference it in code. I also see the custom field (new_chapter) in their D365 instance. The D365 database is the same as the DataVerse correct? I’m not sure where the disconnect may be but any help is appreciated.

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, hope the link below will give you some hints.

    https://yzhums.com/17065/

    Thanks.

    ZHU

  • Suggested answer
    Greg Enns Profile Picture
    1,106 on at

    Did you generate an updated definition of the "Dataverse Account" table in BC? This "integration table" or "proxy table" must have the same definition as the table in Dataverse in order for AL code to interact with the actual dataverse table.

  • Jazzy4321 Profile Picture
    26 on at

    I think this may be the step I'm missing. How do you generate an updated definition of the "Dataverse Account" table in BC?

  • Suggested answer
    Greg Enns Profile Picture
    1,106 on at

    @Erik Hougaard explains it well in this video: www.youtube.com/watch

  • Suggested answer
    Jazzy Profile Picture
    5 on at

    This worked for me. I needed to set /tabletype:CRM when running altpgen.exe.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans