Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Business Central - CRM Sync Customer account No.

Posted on by 5

I am using the native Business Central/CRM Integration Tool.

We have a process where we create new customer accounts in CRM (dataverse) and sync this data down to Business Central which creates a new customer record. I want to map the Customer No. field from Business Central back up to CRM. This field mapping is not part of the default mapping.

I have created some code to add the field mapping into the customer table mapping.

pastedimage1670932148037v1.png

The integration table mapping is setup as Bidirectional as I want to pass information both ways. My problem is that when the job queue runs this runs the job from BC->CRM first then CRM-BC, which means that nothing is sent to CRM, but then the account is then synced down to BC fine.

pastedimage1670932217399v2.png

Any further runs of the job do not send the account number back up to CRM. Currently the only ways I can get the number synced to CRM is to either modify the BC customer record, or to perform manual customer record sync form BC. neither of these are a long term solution.

Any help would be much appreciated.

  • Business Central - CRM Sync Customer account No.
    Empowering everyday users to build custom applications without needing a Ph.D. in coding feels like a game-changer.
  • Suggested answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: Business Central - CRM Sync Customer account No.

    I'm doubtful that the dual mapping jobs would work without a LOT of customization.

    I would first recommend trying the following:

    1. Create a custom subscriber function to Customer.OnAfterInsert
    2. Check and see if the record is coupled to a CRM Account.
    3. If it is coupled, then do the following code:
      1. CRMAccount."Account No." := Customer."No.";
      2. CRMAccount.Modify;

    This may cause the integration to run again, but I don't think it will throw an error. If it doesn't work, there are a number of other publisher functions you could try subscribing to later in the sync process to try and get it to work.

    Another potential solution would be this:

    1. Create a custom boolean field on the Customer record called "PushedToCRM".
    2. Have a separate job queue that would run occasionally (daily? Hourly?) that would mark this field--thus triggering a push to CRM.
  • Verified answer
    Manan_Shah Profile Picture
    Manan_Shah 1,457 on at
    RE: Business Central - CRM Sync Customer account No.

    Hi James,

    I suggest you can create a separate Integration for it. 

    1) Create Customer Record in Business Central from CRM. -> FromDirectional. 

    2) Updated record on Business Central transfer to CRM -> Todirectional.  

    With 2 different Job Queue you can manage it.

    Hope this will help.

    Many Thanks,
    Manan

  • James I Profile Picture
    James I 5 on at
    RE: Business Central - CRM Sync Customer account No.

    I think the issue I am facing is that sync works ok coming from CRM to BC in the first instance to create the record. This then sets the created date\time and modified data\time to be the same date\time. I believe I need the modified date to be adjusted after insert, so that this differs from the creation date\time. Any suggestions?

  • Amit_Sharma Profile Picture
    Amit_Sharma 2,545 on at
    RE: Business Central - CRM Sync Customer account No.

    Hi,

    Adding info

    https://learn.microsoft.com/en-us/dynamics365/business-central/admin-synchronizing-business-central-and-sales

    Regards

    Amit Sharma

    www.erpconsultors.com

  • James I Profile Picture
    James I 5 on at
    RE: Business Central - CRM Sync Customer account No.

    I have had a look through and cannot see anything targetted towards my question. Is there anything specific in the link that relates? Thanks

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Business Central - CRM Sync Customer account No.

    hi

    look this

    learn.microsoft.com/.../admin-prepare-dynamics-365-for-sales-for-integration

    DAniele

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans