[Event Request] Codeunit 5334 "CRM Setup Defaults"
The events in codeunit 5334 do not make it easy to extend the CRM integration. The most common scenario is to be able to add additional field mappings for custom fields.
In all the Reset*Mapping procedures the only event is at the start of the procedure and the only way to add a field is to recreate the entire procedure and set the Ishandled to true. The danger with this is that you lose any changes to the standard code.
It would be beneficial to have an additional event after the fields have been created. For example in procedure ResetItemProductMapping have a new event:
OnResetItemProductMappingAfterInsertFields(IntegrationTableMappingName);
Immediatley before the line: RecreateJobQueueEntryFromIntTableMapping(IntegrationTableMapping, 30, EnqueueJobQueEntry, 1440);
An equivalent event is required for each procedure that handled field mappings for the tabled.
The procedure 'InsertIntegrationFieldMapping' should also not be set to local.
If these changes were made it would be easy for partners to call InsertIntegrationFieldMapping for additional custom fields.
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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.