MATRIX Form update issue

RoddyMcLean
Member Posts: 101
I'm having an issue with Matrix form updates. This is a custom one based on Account Schedules. Everything starts of fine in the following view VIEW1.BMP: -
I select another Account Schedule (called view in my system) VIEW2.BMP: -
After pressing the right cursor button several time the view returns to normal VIEW3.BMP: -
Any help would be greatly appreciated.
Regards
Roddy
I select another Account Schedule (called view in my system) VIEW2.BMP: -
After pressing the right cursor button several time the view returns to normal VIEW3.BMP: -
Any help would be greatly appreciated.
Regards
Roddy
0
Comments
-
I'm sorry, but the images are not visible. (Not here anyway).
Is this a NAV 2009 matrix form? If so then it should have been posted in the NAV 2009 forum.0 -
No classic matrix0
-
Obviously since you have not explained what is going on behind the scenes, this is pure guess work, but I would say that the code you use to calculate the numbers or to set the filters is in the wrong trigger.David Singleton0
-
Hi,
I've used Account Schedules as a template so kept things as close as possible to product. When the user picks a view(schedule) the following code is run: -<Control1100361003> - OnValidate() //ITG0175 >> AccSchedManagement.CheckName(CurrentSchedName); AccSchedManagement.CheckUserSchedule(CurrentSchedName); SETFILTER("Budget Filter", CurrentSchedName); //ITG0175 << <Control1100361003> - OnAfterValidate() //ITG0175 >> CurrForm.SAVERECORD; AccSchedManagement.SetName(CurrentSchedName,Rec); IF AccSchedName.GET(CurrentSchedName) THEN IF (AccSchedName."Default Column Layout" <> '') AND (CurrentColumnName <> AccSchedName."Default Column Layout") THEN BEGIN CurrentColumnName := AccSchedName."Default Column Layout"; AccSchedManagement.CopyColumnsToTemp(CurrentColumnName,TempColumnLayout); AccSchedManagement.SetColumnName(CurrentColumnName,CurrForm.AccSchedMatrix.MatrixRec); END; AccSchedManagement.CheckAnalysisView(CurrentSchedName,CurrentColumnName,TRUE); IF AccSchedName."Analysis View Name" <> AnalysisView.Code THEN BEGIN PrevAnalysisView := AnalysisView; IF AccSchedName."Analysis View Name" <> '' THEN AnalysisView.GET(AccSchedName."Analysis View Name") ELSE BEGIN CLEAR(AnalysisView); AnalysisView."Dimension 1 Code" := GLSetup."Global Dimension 1 Code"; AnalysisView."Dimension 2 Code" := GLSetup."Global Dimension 2 Code"; END; IF PrevAnalysisView."Dimension 1 Code" <> AnalysisView."Dimension 1 Code" THEN SETRANGE("Dimension 1 Filter"); IF PrevAnalysisView."Dimension 2 Code" <> AnalysisView."Dimension 2 Code" THEN SETRANGE("Dimension 2 Filter"); IF PrevAnalysisView."Dimension 3 Code" <> AnalysisView."Dimension 3 Code" THEN SETRANGE("Dimension 3 Filter"); IF PrevAnalysisView."Dimension 4 Code" <> AnalysisView."Dimension 4 Code" THEN SETRANGE("Dimension 4 Filter"); END; CurrForm.Dim1Filter.ENABLED := AnalysisView."Dimension 1 Code" <> ''; CurrForm.Dim2Filter.ENABLED := AnalysisView."Dimension 2 Code" <> ''; CurrForm.Dim3Filter.ENABLED := AnalysisView."Dimension 3 Code" <> ''; CurrForm.Dim4Filter.ENABLED := AnalysisView."Dimension 4 Code" <> ''; //Note, I put the following 2 lines in, removing them makes no difference to problem: - TempColumnLayout.FIND('-'); CurrForm.AccSchedMatrix.MatrixRec := TempColumnLayout; CurrForm.UPDATE(FALSE); CurrForm.UPDATECONTROLS; //ITG0175 <<
On the Matrix form, the account schedule codeunit is run as per standard and I've put my calculations in there: -AccSchedMatrix - OnAfterGetRecord() IF Totaling = '' THEN ColumnValue := 0 ELSE ColumnValue := AccSchedManagement.CalcCell(Rec,CurrForm.AccSchedMatrix.MatrixRec,UseAmtsInAddCurr);
So in codeunit 8, I've added a block sticking close to standard NAV practise: -ELSE //NAV2CISRM IF ColumnLayout."Calc Type" = ColumnLayout."Calc Type"::Adjustment THEN BEGIN WITH CVRAnalysisViewEntry DO BEGIN SETRANGE("Analysis View Code",AccSchedName."Analysis View Name"); IF GLAcc.Totaling = '' THEN SETRANGE("G/L Account No.",GLAcc."No.") ELSE SETFILTER("G/L Account No.",GLAcc.Totaling); GLAcc.COPYFILTER("Date Filter","Posting Date"); AccSchedLine.COPYFILTER("Business Unit Filter","Business Unit Code"); AccSchedLine.COPYFILTER("Dimension 1 Filter","Dimension 1 Value Code"); AccSchedLine.COPYFILTER("Dimension 2 Filter","Dimension 2 Value Code"); AccSchedLine.COPYFILTER("Dimension 3 Filter","Dimension 3 Value Code"); AccSchedLine.COPYFILTER("Dimension 4 Filter","Dimension 4 Value Code"); FILTERGROUP(2); SETFILTER("Dimension 1 Value Code",GetDimTotalingFilter(1,AccSchedLine."Dimension 1 Totaling")); SETFILTER("Dimension 2 Value Code",GetDimTotalingFilter(2,AccSchedLine."Dimension 2 Totaling")); SETFILTER("Dimension 3 Value Code",GetDimTotalingFilter(3,AccSchedLine."Dimension 3 Totaling")); SETFILTER("Dimension 4 Value Code",GetDimTotalingFilter(4,AccSchedLine."Dimension 4 Totaling")); FILTERGROUP(6); SETFILTER("Dimension 1 Value Code",GetDimTotalingFilter(1,ColumnLayout."Dimension 1 Totaling")); SETFILTER("Dimension 2 Value Code",GetDimTotalingFilter(2,ColumnLayout."Dimension 2 Totaling")); SETFILTER("Dimension 3 Value Code",GetDimTotalingFilter(3,ColumnLayout."Dimension 3 Totaling")); SETFILTER("Dimension 4 Value Code",GetDimTotalingFilter(4,ColumnLayout."Dimension 4 Totaling")); SETFILTER("Business Unit Code",ColumnLayout."Business Unit Totaling"); FILTERGROUP(0); CASE AmountType OF AmountType::"Net Amount" : BEGIN IF CalcAddCurr THEN BEGIN CALCSUMS("Add.-Curr. Amount"); ColValue := "Add.-Curr. Amount"; END ELSE BEGIN CALCSUMS(Amount); ColValue := Amount; END; Balance := ColValue; END; AmountType::"Debit Amount" : BEGIN IF CalcAddCurr THEN BEGIN IF TestBalance THEN BEGIN CALCSUMS("Add.-Curr. Debit Amount","Add.-Curr. Amount"); Balance := "Add.-Curr. Amount"; END ELSE CALCSUMS("Add.-Curr. Debit Amount"); ColValue := "Add.-Curr. Debit Amount"; END ELSE BEGIN IF TestBalance THEN BEGIN CALCSUMS("Debit Amount",Amount); Balance := Amount; END ELSE CALCSUMS("Debit Amount"); ColValue := "Debit Amount"; END; END; AmountType::"Credit Amount" : BEGIN IF CalcAddCurr THEN BEGIN IF TestBalance THEN BEGIN CALCSUMS("Add.-Curr. Credit Amount","Add.-Curr. Amount"); Balance := "Add.-Curr. Amount"; END ELSE CALCSUMS("Add.-Curr. Credit Amount"); ColValue := "Add.-Curr. Credit Amount"; END ELSE BEGIN IF TestBalance THEN BEGIN CALCSUMS("Credit Amount",Amount); Balance := Amount; END ELSE CALCSUMS("Credit Amount"); ColValue := "Credit Amount"; END; END; END; END; END ELSE BEGIN IF ((ColumnLayout."Calc Type" = ColumnLayout."Calc Type"::Committed) OR (ColumnLayout."Calc Type" = ColumnLayout."Calc Type"::Accrued)) THEN BEGIN WITH PurchAnalysisViewEntry DO BEGIN SETRANGE("Analysis View Code",AccSchedName."Analysis View Name"); GLAcc.COPYFILTER("Date Filter","Posting Date"); AccSchedLine.COPYFILTER("Dimension 1 Filter","Dimension 1 Value Code"); AccSchedLine.COPYFILTER("Dimension 2 Filter","Dimension 2 Value Code"); AccSchedLine.COPYFILTER("Dimension 3 Filter","Dimension 3 Value Code"); AccSchedLine.COPYFILTER("Dimension 4 Filter","Dimension 4 Value Code"); FILTERGROUP(2); SETFILTER("Dimension 1 Value Code",GetDimTotalingFilter(1,AccSchedLine."Dimension 1 Totaling")); SETFILTER("Dimension 2 Value Code",GetDimTotalingFilter(2,AccSchedLine."Dimension 2 Totaling")); SETFILTER("Dimension 3 Value Code",GetDimTotalingFilter(3,AccSchedLine."Dimension 3 Totaling")); SETFILTER("Dimension 4 Value Code",GetDimTotalingFilter(4,AccSchedLine."Dimension 4 Totaling")); FILTERGROUP(6); SETFILTER("Dimension 1 Value Code",GetDimTotalingFilter(1,ColumnLayout."Dimension 1 Totaling")); SETFILTER("Dimension 2 Value Code",GetDimTotalingFilter(2,ColumnLayout."Dimension 2 Totaling")); SETFILTER("Dimension 3 Value Code",GetDimTotalingFilter(3,ColumnLayout."Dimension 3 Totaling")); SETFILTER("Dimension 4 Value Code",GetDimTotalingFilter(4,ColumnLayout."Dimension 4 Totaling")); FILTERGROUP(0); IF (ColumnLayout."Calc Type" = ColumnLayout."Calc Type"::Accrued) THEN BEGIN CALCSUMS(Accrued); ColValue := Accrued; END ELSE BEGIN CALCSUMS(Committed); ColValue := Committed; END; Balance := ColValue; END; END ELSE BEGIN //NAV2CISRM
Sorry, this is a lot of code. I'm beginning to wonder if matrix forms have a few flaws themselves.
Regards
Roddy0 -
You have to change the code in the SetColumnName function in the "AccSchedManagement" codeunit (8) as follows.
ColumnLayout.RESET;
ColumnLayout.FILTERGROUP(2);
ColumnLayout.SETRANGE("Column Layout Name",CurrentColumnName);
ColumnLayout.FILTERGROUP(0);
// Delete the following line.
IF ColumnLayout.FIND('-') THEN; <--- delete this line- KS -0 -
Thanks,
I appreciate someone getting back. I'd found my way round - eventually.
Roddy0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions