microsoft / ALAppExtensions

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

[Event Request] codeunit 5139 "Job Archive Management" - OnRestoreJobOnBeforeInsertJob #26768

Closed pri-kise closed 5 days ago

pri-kise commented 6 days ago

Describe the request

Could you please add the following event?

procedure RestoreJob(var JobArchive: Record "Job Archive")
var
    Job: Record Job;
    CommentLine: Record "Comment Line";
    ConfirmManagement: Codeunit "Confirm Management";
    RestoreArchivedJob: Boolean;
begin
   ...

        Job.Init();
        Job."No." := JobArchive."No.";
        Job.TransferFields(JobArchive);
        //+EVENT
        OnRestoreJobOnBeforeInsertJob(JobArchive, Job);
        //-EVENT
        Job.Insert(true);
        RecordLinkManagement.CopyLinks(JobArchive, Job);
        Job.Modify(true);

        ...
    end;
end;
[IntegrationEvent(false, false)]
local procedure OnRestoreJobOnBeforeInsertJob(JobArchive: Record "Job Archive"; var Job: Record Job)
begin
end;

Additional context

We have added custom Blob field to the Job/Job Archive and would like to restore this field, too. Therefore we need this event to add CalcFields and an assignment of the Blob value. Internal work item: AB#539934

JesperSchulz commented 5 days 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: 21487.