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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Sync lookup field from Business Central to Dataverse

(5) ShareShare
ReportReport
Posted on by 368
Hello!
 
I have set up a Standard Integration between Business Central and Dataverse. I managed to add a sync between a custom table in BC, to a custom table in Dataverse, and it worked well when testing a few fields.
However, I stumbled upon an issue when I tried to map a field that contains the customer, as I get the following error when trying to map the field:
 
 
The field is just like the "Sell to Customer No." from Sales Orders for example, just a lookup to the Customer table, and it contains the code value of the No. of the customer.
My reason for mentioning the Sales Order, is there is a mapping between the Sales Order customer and the account in Dataverse. Same with the Item on Sales Order Lines. They're just lookups to a different table, just like my field.
 
How can I map this field to a field in Dataverse?
I have the same question (0)
  • Verified answer
    Hagru Profile Picture
    368 on at
    I figured this one out myself, and it was a lot simpler than I thought it would be.
     
    Every other guide or documentation I followed only mentioned standard text fields, but never explained how to sync FlowFields.
     
    The first time I added a new field, I followed this guide : https://bccaptain.com.au/2023/07/18/crm-integration-add-custom-field-to-existing-crm-table/
    And I remembered adding event subscribers to add the fields, but again, they were only text fields.
     
    I figured I would try it either way, but I didn't have a Codeunit to subscribe to, so I just added a button to the Integration Field Mapping page instead to generate the mappings. It worked perfectly, and it syncs to CRM, where it is also related to the customer account in Dataverse.
     
    'NPX_CONTRACTHEADER' is the name of the table mapping I had set up. 
     
    pageextension 55000 IntegrationFieldEXT extends "Integration Field Mapping List"
    {
        actions
        {
            addfirst(Processing)
            {
                action(AddMapping)
                {
                    ApplicationArea = All;
    
                    trigger OnAction()
                    var
                        IntegrationFieldMapping: Record "Integration Field Mapping";
                        NPXContract: Record "NPX Contract Header";
                        CRMContract: Record "CDS new_e_npxcontractheader";
                    begin
                        IntegrationFieldMapping.CreateRecord(
                        'NPX_CONTRACTHEADER', NPXContract.FieldNo("Source No."), CRMContract.FieldNo(new_e_SourceNo),
                        IntegrationFieldMapping.Direction::ToIntegrationTable, '', false, false
                    );
                    end;
                }
            }
        }
    }
     
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 135

#2
Subra Profile Picture

Subra 132

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 101 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans