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 :
Small and medium business | Business Central, N...
Suggested Answer

CRM to Business Central custom integration of GUID field

(0) ShareShare
ReportReport
Posted on by 26

I have an integration between CRM and Business Central (both online) and it's working great for data types that are the same in both systems. I would like to sync a lookup field (guid) from CRM to Business Central by passing the name in the lookup field (custom mapping) to a text field in BC. I have the following in a table extension:

field(60120; new_University; Guid)
        {
            ExternalName = 'new_university';
            ExternalType = 'Lookup';
            Description = '';
            Caption = 'University';
            TableRelation = "CRM Account".AccountId;
        }
and i want to create an entry in the Integration Table Mapping for Customer. I have other fields working just fine, but can't figure out the best way to sync this lookup field.
Thanks.
I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    You have to use the OnAfterResetCustomerAccountMapping event with codeunit "CDS Setup Defaults" and define the fields there whichever you want to transfer into BC central Table.

        [EventSubscriber(ObjectType::Codeunit, Codeunit::"CDS Setup Defaults", 'OnAfterResetCustomerAccountMapping', '', true, true)]
        local procedure HandleOnAfterResetCustomerAccountMapping(IntegrationTableMappingName: Code[20])
        var
            CDSAccount: Record "CRM Account";
            CustomerRec: Record Customer;
            IntegrationFieldMapping: Record "Integration Field Mapping";
        begin
            //CDSAccountID for Customer
            InsertIntegrationFieldMapping(IntegrationTableMappingName, CustomerRec.FieldNo("NXN CDS Account ID"), CDSAccount.FieldNo(AccountId), IntegrationFieldMapping.Direction::Bidirectional, '', true, false);
            InsertIntegrationFieldMapping(IntegrationTableMappingName, CustomerRec.FieldNo("No."), CDSAccount.FieldNo(ceda_BC), IntegrationFieldMapping.Direction::Bidirectional, '', true, false);
        end;
  • Jazzy4321 Profile Picture
    26 on at

    I am able to do this for a variety of fields, but when i map a lookup from CRM it brings the GUID. I would like to get the name in the lookup and insert into a custom text field BC. Not sure how to do this or if there is a better way.

  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    9,128 Super User 2026 Season 1 on at

    Hi Jazzy,

     

    You can achieve the above requirement by making the fieldclass property to FlowField and default a calcformula which then uses your GUID field for lookup.

     

    Please see the below image.

    pastedimage1661670690617v1.png

            field(21; OwningBusinessUnit; GUID)
            {
                ExternalName = 'owningbusinessunit';
                ExternalType = 'Lookup';
                ExternalAccess = Read;
                Description = 'Unique identifier for the business unit that owns the record';
                Caption = 'Owning Business Unit';
                TableRelation = "CRM BusinessUnit".BusinessUnitId;
            }
            field(24; OwningBusinessUnitName; Text[160])
            {
                FieldClass = FlowField;
                CalcFormula = lookup("CRM BusinessUnit".Name where(BusinessUnitId = field(OwningBusinessUnit)));
                ExternalName = 'owningbusinessunitname';
                ExternalType = 'String';
                ExternalAccess = Read;
            }

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 601 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 338 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 329 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans