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

Community site session details

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

Business Central - CRM Sync Customer account No.

(0) ShareShare
ReportReport
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.

I have the same question (0)
  • Community member Profile Picture
    2 on at
    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
    1,106 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
    1,459 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
    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 Profile Picture
    2,557 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
    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
    11,276 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

Responsible AI policies

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

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,708

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,675 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans