ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] CRM integration

Open larswestman opened this issue 7 years ago • 11 comments

The requested events and functions to make external in the attached document (and sample objects) enables the following:

  • Changing the standard sync relations between BC and CRM. With these changes you can take control over the default table/field mappings and e.g. replace the Customer<->Account sync with a custom table instead of the customer table. It's also possible to change sync behavior of individual fields, add fields etc.
  • Control what happens when there are conflicting changes. Maybe you don't want to babysit conflicts and instead decide that when in conflict either BC or CRM overrules the other part.
  • Do preprocessing before sync Sample objects.zip Event requests in CRM sync.docx

larswestman avatar Jan 31 '19 14:01 larswestman

Thank you for your suggestion. This is not a single event request but larger ask. I've created work item for our Integration team and it will be included into our planning for next version.

AlexanderYakunin avatar Feb 14 '19 10:02 AlexanderYakunin

Thank's.

Yes it's quite big since the current CRM-sync isn't very "evented" and it's difficult to do a custom sync setup. I've upgraded the customers database now and the only place we have custom code now is in these codeunits. With this fixed we can move to AL in the next upgrade.

larswestman avatar Feb 14 '19 11:02 larswestman

After some testing I have a change in how to automatically resolve conflicts. I have attached an updated document. Event requests in CRM sync.docx

larswestman avatar Feb 19 '19 08:02 larswestman

Yes, very much needed. @JesperSchulz what release is this planned for?

peterz84 avatar Apr 15 '19 10:04 peterz84

Hi @AlexanderYakunin,

can you make this happen for BC Version 15? And why even wait? Don't you what us Partner extend the CRM Connector to all CRM Modules like Customer Service, Field Service and Project Service Automation for happy Cloud Customers?

I like to add some more: Codeunit 5332:

[External] Lookup(CRMTableID : Integer;NAVTableId : Integer;SavedCRMId : GUID;VAR CRMId : GUID) : Boolean
IntTableFilter := GetIntegrationTableFilter(CRMTableID,NAVTableId);

//+++ BEGIN +++
OnBeforeLookup(CRMTableID, NAVTableId, SavedCRMId, CRMId, IntTableFilter, LookupOkValue, Handled);
IF Handled THEN
  EXIT(LookupOkValue);
//--- END ---

Codeunit 5332:

[External] ResetConfiguration(CRMConnectionSetup : Record "CRM Connection Setup")
[...]

ResetDefaultCRMPricelevel(CRMConnectionSetup);

//+++ BEGIN +++
OnAfterResetConfiguration(EnqueueJobQueEntries);
//--- END ---

IF ConnectionName <> '' THEN
  TempCRMConnectionSetup.UnregisterConnectionWithName(ConnectionName);

[...]
[External] GetCRMTableNo(NAVTableID : Integer) : Integer
//+++ BEGIN +++
//Handled Pattern insted:
OnBeforeGetCRMTableNo(NAVTableID, CRMTableId, Handled);
IF Handled THEN
  EXIT(CRMTableId);
//--- END ---

[...]
[External] GetNameFieldNo(TableID : Integer) : Integer
//+++ BEGIN +++
OnBeforeGetNameFieldNo(TableID, FieldNo, Handled);
IF Handled THEN
  EXIT(FieldNo);
//--- END ---

[...]
[External] GetTableIDCRMEntityNameMapping(VAR TempNameValueBuffer : TEMPORARY Record "Name/Value Buffer")
TempNameValueBuffer.RESET;
TempNameValueBuffer.DELETEALL;

[...]

// Only CRM
AddEntityTableMapping('incident',DATABASE::"CRM Incident",TempNameValueBuffer);
AddEntityTableMapping('quote',DATABASE::"CRM Quote",TempNameValueBuffer);

//+++ BEGIN +++
OnAfterGetTableIDCRMEntityNameMapping(TempNameValueBuffer);
//--- END ---

[...]
LOCAL [IntegrationEvent] OnAfterResetConfiguration(EnqueueJobQueEntries : Boolean)

LOCAL [IntegrationEvent] OnBeforeGetCRMTableNo(NAVTableID : Integer;VAR CRMTableId : Integer;VAR Handled : Boolean)

LOCAL [IntegrationEvent] OnBeforeGetNameFieldNo(TableID : Integer;VAR FieldNo : Integer;VAR Handled : Boolean)

LOCAL [IntegrationEvent] OnAfterGetTableIDCRMEntityNameMapping(VAR TempNameValueBuffer : TEMPORARY Record "Name/Value Buffer")

DanielGoehler avatar Aug 22 '19 21:08 DanielGoehler

We are in the process of adding the events for the upcoming release.

Thanks Anders

AndersLarsen65 avatar Jan 16 '20 11:01 AndersLarsen65

Sounds great! Please see the document I posted feb 19.

larswestman avatar Jan 16 '20 12:01 larswestman

@AndersLarsen65 CU or have we wait until the wave 1 2020?

DanielGoehler avatar Jan 16 '20 18:01 DanielGoehler

I am afraid you will have to wait until wave 1 2020. we are turning the cds integration for the upcoming release with the focus on improved mapping and SaaS capability for extending integration to CDS including improvement of the tooling.

AndersLarsen65 avatar Jan 17 '20 08:01 AndersLarsen65

@AndersLarsen65 Do plan to make the table type CRM/CDS extendable?

DanielGoehler avatar Jan 20 '20 20:01 DanielGoehler

Answer from Anders on Yammer:

"For wave 1 we will make the existing proxy tables (CDS/CRM) extensible. Transform payment term and shipping method from option to extensible enum. Adding transformation extensibility for “mapping” by kicking in the datatransformation framework plus allowing custom code to kick in if needed"

Closing issue based on that comment. Please open new issue, if you have further requests or questions :-)

JesperSchulz avatar Jan 23 '20 14:01 JesperSchulz