ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Event Request in function CompareDateTime in CU TypeHelper

Open DanielHaglo opened this issue 6 years ago • 11 comments

Hi,

I request an event OnBeforeCompareDateTime in typehelper. The function needs to exit on an return variable, so that need to be changed as well.

image

DanielHaglo avatar Jan 27 '20 08:01 DanielHaglo

Before going forward with this request, I'd like to understand, why you would need to alter the behavior of the CompareDateTime function. Could you elaborate?

JesperSchulz avatar Feb 10 '20 15:02 JesperSchulz

Hello Jesper,

The main reason i want this, is because when the CRM synchronization runs, it will check wether or not the record is changed in both business central and CRM, and it will give an error saying that it couldnt synch. the record.

After hours of debugging i found out that it took longer than 10 milliseconds to update the "Integration Record"."Modified On" or "CRM Integration Record"."Modified On" So basically it checks if the recordref (for instances Customers or Contacts) modified date against the integration record modified date. And if this is less than 10 milliseconds it is ok, but we had over thousand of cases in Dynamics NAV 2018 that was about 14-100 milliseconds different. I dont know if this is a problem due to slow servers, but i also tested the integration in BC, and i got the same problem there. Not often, but often enough.

(I testet this with a clean Business Central and CRM Online as well, just to be sure)

Therefore i thought this might be the solution. Either change so that it is ok to at least have 500 milliseconds difference or that we have the possibility to change it. The synchronization is totally out of control when this problem comes. Our customers have to do a lot of manual work even if they are not changing the record in both applications.

If you look into the function GetRowLastModifed and later on into IsModifiedAfterRecordLastSynch or IsModifiedAfterIntegrationTableRecordLastSynch. Its the same problem with Integratons Record as it is with CRM Integraton Record.

image

Hopes this made a somewhat sense :)

DanielHaglo avatar Feb 10 '20 17:02 DanielHaglo

Thanks for this detailed explanation! That definitely makes sense and is something we need to address asap. But please allow me to discuss this with our integration team, before I add the event. This to me sounds more like an issue we should handle in the app, rather than having you work around it through an event.

JesperSchulz avatar Feb 11 '20 08:02 JesperSchulz

We have a slice to address the false negatives when it comes to detecting whether a coupled record was modified in both systems. The current plan is to deliver this improvement for Business Central release in October this year. How urgent/painful is this issue? Can you wait until October release?

dcenic avatar Feb 12 '20 09:02 dcenic

Our customer is going live in May, so we kind of need this before then if possible.

DanielHaglo avatar Feb 12 '20 10:02 DanielHaglo

We want to avoid having events raised by the Type Helper codeunit. Would it work if we raise an event from the integration engine - from WasModifiedAfterLastSync method? Please come up with a suggestion for that kind of event.

dcenic avatar Feb 12 '20 10:02 dcenic

What about two events in CRM Integration Record Table?

image

DanielHaglo avatar Feb 13 '20 07:02 DanielHaglo

Yes, but shouldn't they be like this:

IsModifiedAfterLastSynchronizedCRMRecord(CRMID, DestinationTableID, CurrentModifiedOn, IsModified, Handled);

and IsModifiedAfterLastSynchronizedRecord(RecordID, CurrentModifiedOn, IsModified, Handled); because in this method you don't have CRMID and DestinationTableID.

dcenic avatar Feb 13 '20 08:02 dcenic

Of course. i copy pasted, my bad.

This will be just fine.

DanielHaglo avatar Feb 13 '20 08:02 DanielHaglo

I will add those to the next upcoming major (April) release.

JesperSchulz avatar Feb 13 '20 09:02 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Feb 17 '20 13:02 bc-ghost