My client would like to see the Week view as a date (Mondays) on form 99000919 Production Forecast. I have already seen this done for the standard Navision form 113 Budget but am having a hard time finding the code that populates the MatrixHeader. Can someone tell me where to look?
Hi William, Form 113 uses Dimension Code Buffer as MatrixSourceTable where Form 99000919 uses Date, so it won’t be of much help. Have a look at Codeunit 359, Function CreatePeriodFormat and do the following.
PeriodType::Week: BEGIN // Add this line EXIT(FORMAT(Date)); IF DATE2DWY(Date,2) = 1 THEN Date := Date + 7 - DATE2DWY(Date,1); EXIT(FORMAT(Date,0,Text000)); END; This modification will be universal for all Matrixforms using the Date table. Alternatively you can create your own function specifically for form 99000919 (simply make a copy of the function, rename it, make the above modification and call the new function instead). BTW: In form 113, the code that populates the MatrixHeader variable is found in the OnAfterGetRecord() trigger of the Matrix Box.
Thanks, that worked great!