microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
768 stars 610 forks source link

codeunit 5060 "DuplicateManagement" - new integration event in procedure MakeContIndex #26935

Closed MichelDecker123 closed 1 month ago

MichelDecker123 commented 1 month ago

Describe the request

To generate duplicate strings without searching for duplicates we would like to have an additional integration event: OnBeforeInsDuplCont

procedure MakeContIndex(Cont: Record Contact)
var
    DuplSearchStringSetup: Record "Duplicate Search String Setup";
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnMakeContIndex(Cont, IsHandled);
    if IsHandled then
        exit;

    RMSetup.Get();

    RemoveContIndex(Cont, true);

    if DuplSearchStringSetup.Find('-') then
        repeat
            InsDuplContIndex(Cont, DuplSearchStringSetup);
        until DuplSearchStringSetup.Next() = 0;

    //event call added
    OnBeforeInsDuplCont(Cont, IsHandled);
    if IsHandled then
        exit;
    InsDuplCont(Cont, RMSetup."Search Hit %");
end;

new event

[IntegrationEvent(false, false)]
local procedure OnBeforeInsDuplCont(var Contact: Record Contact; var IsHandled: Boolean)
begin
end;

Additional context

While migration processes we lose a bunch of time, because we need to generate duplicate strings, but we do not want to search for duplicates. It is, unfortunately, not possible at the moment, to make the search optional. That is why, currently, we have to copy this procedure, but we would like to reuse the existing procedure.

Internal work item: AB#543330

azure-boards[bot] commented 1 month ago

✅ Successfully linked to Azure Boards work item(s):

JesperSchulz commented 1 month ago

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. 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.

Build ID: 22697.