ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Page 193 'Incoming Doc. Attach. FactBox' - LoadDataFromRecord procedure OnLoadDataFromRecordOnBeforeDeleteAll event

Open polina-se opened this issue 1 year ago • 1 comments

Why do you need this change?

Dear Microsoft Team, On behalf of Allvue, I want to request a change in the existing event OnLoadDataFromRecordOnBeforeDeleteAll and procedure LoadDataFromRecord of page 193, 'Incoming Doc. Attach. FactBox'. We need to prevent the deletion of all records from the Rec in the LoadDataFromRecord procedure of page 193, 'Incoming Doc. Attach. FactBox'.

Describe the request

I would like to request the addition of the IsHandled parameter to the OnLoadDataFromRecordOnBeforeDeleteAll event. This variable will prevent the deletion of all records from the Rec in the LoadDataFromRecord procedure of page 193, 'Incoming Doc. Attach. FactBox'. Please implement these changes in the BC25 version.

Event Code:

[IntegrationEvent(false, false)]
local procedure OnLoadDataFromRecordOnBeforeDeleteAll(var TempIncDocAttachmentOverview: Record "Inc. Doc. Attachment Overview" temporary; var IsHandled: Boolean) // new parameter
begin
end;

Procedure Code:

procedure LoadDataFromRecord(MainRecordVariant: Variant)
var
    IncomingDocument: Record "Incoming Document";
    DataTypeManagement: Codeunit "Data Type Management";
begin
    LoadedDataFromRecord := true;

    if not DataTypeManagement.GetRecordRef(MainRecordVariant, MainRecordRef) then
        exit;

    IsHandled := false; // new
    OnLoadDataFromRecordOnBeforeDeleteAll(Rec, IsHandled); // new parameter
    if IsHandled then // new
      Rec.DeleteAll();

    if not MainRecordRef.Get(MainRecordRef.RecordId) then
        exit;

    if GetIncomingDocumentRecord(MainRecordVariant, IncomingDocument) then
        Rec.InsertFromIncomingDocument(IncomingDocument, Rec);

    OnAfterLoadDataFromRecord(MainRecordRef);
    CurrPage.Update(false);
end;

Internal work item: AB#592257

polina-se avatar Jul 15 '25 14:07 polina-se

Thank you for your request.

After reviewing the proposed event we have decided not to implement this modification. We do not consider this a suitable general integration point for the application.

If the current implementation does not meet your specific requirements, we recommend implementing your own version of the FactBox to accommodate your custom logic.

stkillen avatar Jul 25 '25 12:07 stkillen