WorkCenter/MachineCenter: add Capacity Shown In to Calendar and Load pages#9214
Open
Busslar wants to merge 4 commits into
Open
Conversation
… in calendar matrix and load lines Machine Center has no "Unit of Measure Code" field. Both MachineCenterCalendarMatrix (MATRIX_OnAfterGetRecord) and MachineCenterLoadLines (CalcLine) referenced that non-existent field, causing four AL0132 compile errors. Fix: look up the parent Work Center via MachineCenter."Work Center No." and use WorkCenter."Unit of Measure Code" as the TimeFactor numerator. The existing else-branch (CapacityTimeFactor := 1 / raw cell value) now also covers "Work Center No." = '' and a failed WorkCenter.Get, so the guard is both correct and complete. Also fixes a missing semicolon on the CapacityTimeFactor: Decimal variable declaration in MachineCenterLoadLines.CalcLine.
…ace in Machine Center pages MachineCenterCalendarMatrix and MachineCenterLoadLines now reference Record "Work Center" after the UoM lookup fix. Both files are in the Microsoft.Manufacturing.MachineCenter namespace, so the WorkCenter table was unresolvable without an explicit using statement. Add: using Microsoft.Manufacturing.WorkCenter
Author
@microsoft-github-policy-service agree company="GOB-Software-Systeme" |
Author
|
@microsoft-github-policy-service agree company="GOB-Software-Systeme" |
Contributor
|
Issue #9205 is not valid. Please make sure you link an issue that exists, is open and is approved. |
SPinkow
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With reference to microsoft/BusinessCentralApps#1893
Fixes #9205
Fixes #9205
Work Center and Machine Center Calendar and Load pages were missing the Capacity Shown In field that the Work Center Group pages already have. This meant capacity figures were always displayed in the center's native unit of measure with no way to switch between seconds, minutes, hours, or days.
Changes
Calendar pages (WorkCenterCalendar, MachineCenterCalendar)
Added Capacity Shown In field in the Matrix Options group, positioned after View by
OnOpenPage initializes the field from \Manufacturing Setup.\Show Capacity In\ (with TestField guard, matching Work Ctr. Group Calendar behavior)
The selected unit is forwarded to the matrix via \Load()\
Calendar matrix pages (WorkCenterCalendarMatrix, MachineCenterCalendarMatrix)
Extended \Load()\ with a \SetCapacityUoM: Code[10]\ parameter (aligning with \Work Ctr. Grp. Calendar Matrix)
\MATRIX_OnAfterGetRecord\ now converts the \Capacity (Effective)\ flow field using \Shop Calendar Management.\TimeFactor()\ before assigning to the cell
#Load pages (WorkCenterLoad, MachineCenterLoad)
Added Capacity Shown In field in the Options group with \TableRelation = Capacity Unit of Measure.Code\ and OnValidate refresh
OnOpenPage initializes from \Manufacturing Setup.\Show Capacity In
The value is passed to the load lines subpage via \SetLines()
Load lines pages (WorkCenterLoadLines, MachineCenterLoadLines)
Extended \SetLines()\ with \NewCapUoM: Code[10]\ parameter (aligning with \Work Center Group Load Lines)
\CalcLine()\ applies the TimeFactor conversion to Capacity, Allocated Qty., and Availability After Orders
Load % remains a pure ratio and is unaffected by unit conversion
Pattern followed
All changes mirror the existing implementation in:
\Work Ctr. Group Calendar\ (page 99000771)
\Work Ctr. Grp. Calendar Matrix\ (page 9295)
\Work Center Group Load\ (page 99000891)
\Work Center Group Load Lines\ (page 99000892)
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility
None