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

CRM Sync - LastModifiedOn Date - Is this a bug?

(0) ShareShare
ReportReport
Posted on by 1,106

In Codeunit 5340 of all current versions of BC, there is some odd code going on that I think might be a bug.

In the function UpdateTableMappingModifiedOn the array of "LastModifiedOn" is used to update the filters in the TableMapping to limit the scope of future searches for changed records in the table. But the array is being used backwards.

C5340.CRMIntegrationTableSynch.UpdateTableMappingModifiedOn.jpg

Am I wrong?

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    Apart from looking at the code only, do you also see this happening from functional perspective. Then feel free to raise it so we can look after it in more detail.

    Thanks.

  • Greg Enns Profile Picture
    1,106 on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Yes, this is definitely a problem from a functional perspective. The LastModifiedOn is the last time that a record (which matches the TableMapping filters) was modified. Because these are switched the filters get set incorrectly. In a BiDirectional integration, the NavToCRM direction happens first. At the end of this sync, the code shown in my screenshot above will take the latest ModifiedOn from NAV and set it as the filter for looking at CRM records.

  • Greg Enns Profile Picture
    1,106 on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Here's how you can test the bug if you already have the CRM Integration running.

    (I doubt this would work during a "Full Synchronization".)

    CRM Record A is coupled to BC Record A.

    CRM Record B is coupled to BC Record B.

    1. Pause the appropriate CRM Sync Job Queue in BC.

    2. Modify Record A in CRM.

    3. Wait 1 minute

    4. Modify Record B in BC.

    5. Restart the Job Queue.

    The first step in the sync will sync Record B from BC TO CRM.

    The next step will look for records to sync from CRM TO BC. It will NOT see Record A because the IntegrationTable."Synch. Int. Tbl. Mod. On Filter" will be set with the ModifiedOn of Record B in BC.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    Okay, I will check it in v18 ((SaaS release) and report in this forum after I verified the scenario. You may be asked to raise a support request via your partner or CSP so that we can track it correctly and also prioritize it.

    Thank you.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    As promised, I ran the scenario.

    1. SaaS v18.5

    2. Trail Subscription CRM

    3. perform full sync (all good)

    4. create two records in BC (two customers in BC)

    5. couple manually (all good)

    6. set job queue that synchs customer to OnHold ( CUSTOMER - Dataverse synchronization job.)

    7. adjust name with (Modified) using first created customer in BC

    8. wait one minute

    9. adjust name with (Modified) using second created customer in BC

    10. set job queue that synchs customer to Ready ( CUSTOMER - Dataverse synchronization job.) after adjusting field Earliest Start Date/Time to one minute after current time

    Result:

    In DataVerse / CRM, both records are adjusted with (Modified).

    Thanks.

  • Greg Enns Profile Picture
    1,106 on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Thanks for testing this, Marco. I think we had a slight miscommunication though.

    In your list of steps, step 7 should have been a modification made IN CRM. And then in Step 10, you are looking to see if that modification makes it into NAV.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    Let me test this again then. I thought something must have been off as you were very precise in the repro steps. I will come back to you later, hopefully today.

    Thanks.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    After re-doing your adjusted repro steps on your behalf, both newly created records are in sync in both systems. Let me ask one of the App developers here to verify what you wrote as well from code perspective.

    What release you are using? You mentioned NAV instead of BC?

    Thanks.

  • Greg Enns Profile Picture
    1,106 on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Thanks for looking into this Marco. I've been on NAV for too many years, so I'm still getting used to saying BC instead of NAV. :) I am on BC14. The code has changed a little since BC14. The screenshot I sent was from US18 but it looked to me like the issue still remained. 

    What I saw happening in BC14 was that after syncing a group of records from BC to CRM, the system would take the most recent ModifiedOn datetime from those BC records and set it as the filter for looking at CRM records instead of as a filter for the next search of BC records.

  • Verified answer
    Marco Mels Profile Picture
    on at
    RE: CRM Sync - LastModifiedOn Date - Is this a bug?

    Hello,

    The product group responded to me that the code is correct. 

    ///
    The code is correct. See the screenshots below.

    • “Synch. Modified on Filter” is used for filtering CRM records.
    • “Synch. Int. Tbl. Mod. On Fltr.” is used for filtering BC records.

    1134.png

     

     0842.png

     

     6562.png

    8117.png

    I was not able to reproduce the scenario either using a simplified repro in a CRONUS company (SaaS / latest greatest build).

     Thanks.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,160

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,943

#3
Sumit Singh Profile Picture

Sumit Singh 2,823

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans