ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Page 9229 "Res. Avail. (Service) Matrix", procedure MatrixOnAfterGetRecord; OnMatrixOnAfterGetRecordOnBeforeCalculateMatrixCellData

Open nd2403 opened this issue 4 years ago • 1 comments

Hello, we need a way to influence calculation of MATRIX_CellData. Thank you in advance!

local procedure MatrixOnAfterGetRecord()
    var
        I: Integer;
// - new
        IsHandled: Boolean;
// + new
    begin
        MatrixRec.Reset();
        MatrixRec.SetRange("No.", "No.");
        for I := 1 to ArrayLen(MatrixColumnDateFilters) do begin
            MATRIX_CellData[I] := 0;
            MatrixRec.SetRange("Date Filter", MatrixColumnDateFilters[I]."Period Start",
              MatrixColumnDateFilters[I]."Period End");
            if MatrixRec.Find('-') then
                repeat
// - new
                    IsHandled := false;
                    OnMatrixOnAfterGetRecordOnBeforeCalculateMatrixCellData(MatrixRec, MATRIX_CellData, I, IsHandled);
                    if not IsHandled then begin
// + new
                        MatrixRec.CALCFIELDS(Capacity, "Qty. on Service Order");
                        MATRIX_CellData[I] := MatrixRec.Capacity -
                         MatrixRec."Qty. on Service Order";
// - new
                    end;
// + new
                until MatrixRec.Next() = 0;
        end;

        SetVisible;
    end; 
    [IntegrationEvent(false, false)]
    local procedure OnMatrixOnAfterGetRecordOnBeforeCalculateMatrixCellData(var MatrixRec: Record Resource; var MATRIX_CellData: array[32] of Decimal; i: Integer; var IsHandled: Boolean)
    begin
    end; 

nd2403 avatar Dec 09 '21 13:12 nd2403

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.

JesperSchulz avatar Jan 11 '22 07:01 JesperSchulz