Add OnAfterMatrixOnAfterGetRecord event to page 9229 "Res. Avail. (Service) Matrix"
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design
Research direction
Open page 9229, "Res. Avail. (Service) Matrix", and inspect MatrixOnAfterGetRecord along with the existing OnBeforeMatrixOnAfterGetRecord event. Add the requested after-calculation integration event with the stated parameters, then verify that an event subscriber can adjust the calculated matrix cells for the current resource and date filters.
Written by the indexing model from the issue text.
Description
Why do you need this change?
Request
Please add an OnAfterMatrixOnAfterGetRecord integration event to page 9229
"Res. Avail. (Service) Matrix".
Business scenario
We extend resource availability with hours allocated to assembly orders. These
hours must be deducted from every calculated availability cell in the matrix.
The calculation is based on a custom FlowField on the Resource table, filtered
by the current resource and each matrix column's date filter.
Current extensibility limitation
Page 9229 currently exposes the following event:
[IntegrationEvent(false, false)]
local procedure OnBeforeMatrixOnAfterGetRecord(
var MatrixRec: Record Resource;
var MATRIX_CellData: array[32] of Decimal;
var MatrixColumnDateFilters: array[32] of Record Date;
var IsHandled: Boolean)
begin
end;
This event is raised before the standard procedure initializes MatrixRec with
the current page record:
MatrixRec.Reset();
MatrixRec.SetRange("No.", Rec."No.");
The subscriber therefore has no access to the resource represented by the
current row (Rec."No."). It cannot safely replace the standard calculation
using IsHandled := true.
Changing the signature of the existing event could be a breaking change for
existing subscribers. A new event after the standard calculation would avoid
that compatibility risk.
Describe the request
Please raise the following event at the end of
MatrixOnAfterGetRecord(), after the standard matrix cells have been
calculated and before or after SetVisible():
[IntegrationEvent(false, false)]
local procedure OnAfterMatrixOnAfterGetRecord(
Resource: Record Resource;
var MatrixCellData: array[32] of Decimal;
MatrixColumnDateFilters: array[32] of Record Date)
begin
end;
Suggested placement:
local procedure MatrixOnAfterGetRecord()
var
I: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeMatrixOnAfterGetRecord(MatrixRec, MATRIX_CellData, MatrixColumnDateFilters, IsHandled);
if IsHandled then
exit;
MatrixRec.Reset();
MatrixRec.SetRange("No.", Rec."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
MatrixRec.CalcFields(Capacity, "Qty. on Service Order");
MATRIX_CellData[I] := MatrixRec.Capacity - MatrixRec."Qty. on Service Order";
until MatrixRec.Next() = 0;
end;
OnAfterMatrixOnAfterGetRecord(Rec, MATRIX_CellData, MatrixColumnDateFilters);
SetVisible();
end;
Example extension usage:
[EventSubscriber(
ObjectType::Page,
Page::"Res. Avail. (Service) Matrix",
OnAfterMatrixOnAfterGetRecord,
'',
false,
false)]
local procedure ResAvailServiceMatrix_OnAfterMatrixOnAfterGetRecord(
Resource: Record Resource;
var MatrixCellData: array[32] of Decimal;
MatrixColumnDateFilters: array[32] of Record Date)
var
ResourceForCalculation: Record Resource;
ColumnNo: Integer;
begin
ResourceForCalculation.SetRange("No.", Resource."No.");
for ColumnNo := 1 to ArrayLen(MatrixColumnDateFilters) do begin
ResourceForCalculation.SetRange(
"Date Filter",
MatrixColumnDateFilters[ColumnNo]."Period Start",
MatrixColumnDateFilters[ColumnNo]."Period End");
ResourceForCalculation.CalcFields("Qty.onAssemblyOrderAlloc._pte");
MatrixCellData[ColumnNo] -=
ResourceForCalculation."Qty.onAssemblyOrderAlloc._pte";
end;
end;
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 621
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/BCApps
-
Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Approved event-request ext-ready-to-implement Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Approved event-request ext-ready-to-implement Team: SCM
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
event-request Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in microsoft/BCApps
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100