Hi MS team,
We need a new event in this piece of code, in Codeunit 5330 “CRM Integration Management” – FindCoupledToCRMField function, whereby an event should be raised so we can skip/override this call and exit with False if we don’t want to use the “Coupled to CRM” field.
- This is because if the record syncs when users are still working on the record, users will lose their changes and they will be forced to refresh the page. This is valid on both standard and custom integrations.
- Also this could be useful if at any point in time the field is added in a custom integration table and for the above reason you want to disable the field, then either a test should be added in the code to check if the field was Removed, or a custom subscriber would be used if the above event is added.
Kind Regards,
Robert Bulugea
Comments
The code that needs to change in codeunit 5330 is:“internal procedure FindCoupledToCRMField(var RecRef: RecordRef; var CoupledToCRMFldRef: FieldRef): Boolean var Field: Record "Field"; Customer: Record Customer; TableNo: Integer; FieldNo: Integer; begin TableNo := RecRef.Number(); Ishandled := false; OnBeforeFindCoupledToCRMField(TableNo,var Ishandled); If ishandled then exit(false); if CachedCoupledToCRMFieldNo.ContainsKey(TableNo) then FieldNo := CachedCoupledToCRMFieldNo.Get(TableNo) else begin Field.SetRange(TableNo, TableNo); Field.SetRange(Type, Field.Type::Boolean); Field.SetRange(FieldName, Customer.FieldName("Coupled to CRM")); if Field.FindFirst() then FieldNo := Field."No." else FieldNo := 0; CachedCoupledToCRMFieldNo.Add(TableNo, FieldNo); end; if FieldNo = 0 then exit(false); CoupledToCRMFldRef := RecRef.Field(FieldNo); exit(true); end;”
Category: Data Migrations
Business Central Team (administrator)
Thank you for reaching out. Your suggestion seems to be an event request, enum request, request for making a function external or general code contribution in for a product. Please create an issue on one of following GitHub repos:
Read more about finding right resource and providing feedback on this blog post:
https://community.dynamics.com/business/b/financials/archive/2018/12/04/find-the-right-resources-and-provide-feedback
Sincerely,
Business Central Team