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...
Answered

CDS integration, I cannot figure it out

(0) ShareShare
ReportReport
Posted on by 487

Greetings Everyone,

I have hit a brick wall and need your help please.

Context:

- using the CDS integration, I create contacts in BC coming from the CDS

- BC refuses to create contacts if they do not have a parentcustomerid in the cds (you can find it here: CRMIntTableSubscriber.Codeunit.al, line 499

- a big chunk of our contacts dont have, and wont have a parentcustomerid in the cds

I am trying to intercept the record in an event so that I can fill in a general parentcustomerid to make the system happy, but I cannot seem to catch it to do that, it is driving me nuts for hours.

I have tried :

- OnFindUnCoupledDestinationRecord

- OnBeforeTransferRecordFields

With something like:

   if (SourceRecordRef.Number() Database::"CRM Contact"then begin
            SourceRecordRef.SetTable(cdsrec);
            cdsrec.ParentCustomerId := 'MY-GUID';
        end;

But it is simply ignored, and returns the eternally taunting:

The contact cannot be created because the company does not exist.

Please, any advice on how to get around this silly block?

Cheers

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    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

    dynamicsuser.net/.../developers

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

  • Verified answer
    Hedi Daneels Profile Picture
    487 on at

    For the archives, and maybe to help someone one day

    - I did not found a solution for this, so I took a different approach. I made a new integration and new mapping, from CRM contacts to BC customers, and used a bit of "onafterinsert" code to make some modifications.

    Cheers Everyone

  • Suggested answer
    pooya Profile Picture
    25 on at

    it caused by wrong code in a procedure in codeunit CRMSyncHelper(maybe CDSSyncHelper in newer versions)

     local procedure FindCustomersContactByAccountId(var Contact: Record Contact; AccountId: Guid): Boolean
        var
            ContactBusinessRelation: Record "Contact Business Relation";
            CRMIntegrationRecord: Record "CRM Integration Record";
            Customer: Record Customer;
            CustomerRecordID: RecordID;
            OutOfMapFilter: Boolean;
        begin
            if IsNullGuid(AccountId) then
                exit(false); //IT SHOULD BE CHANGES TO TRUE

    as you can see it returns false when parent account is null, but you can simply change it to true.

    as you may know you can not edit base application codes by default but it is possible as you can see in bellow link

    Publishing a Code-Customized Base Application - Business Central | Microsoft Docs

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 2,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans