...
COPYFILTER("Business Unit Filter",GLAcc."Business Unit Filter");
GLAcc.FILTERGROUP(2);
GLAcc.SETFILTER("Global Dimension 1 Filter",AccSchedManagement.GetDimTotalingFilter(1,"Dimension 1 Totaling"));
GLAcc.SETFILTER("Global Dimension 2 Filter",AccSchedManagement.GetDimTotalingFilter(2,"Dimension 2 Totaling"));
GLAcc.FILTERGROUP(6);
// Delete the following lines.
GLAcc.SETFILTER(
"Global Dimension 1 Filter",
AccSchedManagement.GetDimTotalingFilter(1,MatrixRecords[MATRIX_ColumnOrdinal]."Dimension 1 Totaling"));
GLAcc.SETFILTER(
"Global Dimension 2 Filter",
AccSchedManagement.GetDimTotalingFilter(2,MatrixRecords[MATRIX_ColumnOrdinal]."Dimension 2 Totaling"));
GLAcc.SETFILTER("Business Unit Filter",MatrixRecords[MATRIX_ColumnOrdinal]."Business Unit Totaling");
GLAcc.FILTERGROUP(0);
// End of the lines.
FORM.RUN(FORM::"Chart of Accounts (G/L)",GLAcc)
END ELSE BEGIN
GLAcc.COPYFILTER("Date Filter",GLAccAnalysisView."Date Filter");
GLAcc.COPYFILTER("Budget Filter",GLAccAnalysisView."Budget Filter");
GLAcc.COPYFILTER("Business Unit Filter",GLAccAnalysisView."Business Unit Filter");
...
...
COPYFILTER("Business Unit Filter",GLAcc."Business Unit Filter");
GLAcc.FILTERGROUP(2);
GLAcc.SETFILTER("Global Dimension 1 Filter",AccSchedManagement.GetDimTotalingFilter(1,"Dimension 1 Totaling"));
GLAcc.SETFILTER("Global Dimension 2 Filter",AccSchedManagement.GetDimTotalingFilter(2,"Dimension 2 Totaling"));
GLAcc.FILTERGROUP(6);
// Add the following lines.
Dimension1Totaling := AccSchedManagement.GetDimTotalingFilter(1,MatrixRecords[MATRIX_ColumnOrdinal]."Dimension 1 Totaling");
Dimension2Totaling := AccSchedManagement.GetDimTotalingFilter(2,MatrixRecords[MATRIX_ColumnOrdinal]."Dimension 2 Totaling");
GLAcc.SETFILTER("Global Dimension 1 Filter",Dimension1Totaling);
GLAcc.SETFILTER("Global Dimension 2 Filter",Dimension2Totaling);
GLAcc.SETFILTER("Business Unit Filter",MatrixRecords[MATRIX_ColumnOrdinal]."Business Unit Totaling");
GLAcc.FILTERGROUP(0);
IF Dimension1Totaling <> '' THEN
GLAcc.SETFILTER("Global Dimension 1 Filter",Dimension1Totaling);
IF Dimension2Totaling <> '' THEN
GLAcc.SETFILTER("Global Dimension 2 Filter",Dimension2Totaling);
//End of the lines.
FORM.RUN(FORM::"Chart of Accounts (G/L)",GLAcc)
END ELSE BEGIN
GLAcc.COPYFILTER("Date Filter",GLAccAnalysisView."Date Filter");
GLAcc.COPYFILTER("Budget Filter",GLAccAnalysisView."Budget Filter");
GLAcc.COPYFILTER("Business Unit Filter",GLAccAnalysisView."Business Unit Filter");
...