Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

NAV Development Report - Account Schedules

Posted on by Microsoft Employee

We have created a 'SUMMARY' report for account schedules.

We would like to show which "branch" aka "dimension" the summary is for in the header.

Can anyone help me begin; I have attempted everything with no luck.

Thank you.

*This post is locked for comments

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: NAV Development Report - Account Schedules

    Why you want to develop a report from scratch. You can use the "Account Schedule" or "Analysis by Dimension" to achieve your requirement.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: NAV Development Report - Account Schedules

    Have you tried configure Account Schedule and see if "Acc. Schedule Overview" works for you? If it works, you can modify the standard Report 25 as per your need.

  • Suggested answer
    RE: NAV Development Report - Account Schedules

    Hi,

    If Branch is your Global Dimension, then when you input data on the Request Page, it get captured under Dim1Filter, Dim2Filter, Dim3Filter, Dim4Filter variables. Check screenshot.

    If you call these variables on your header as per your requirement, you are good.

    df.PNG

    Hope it helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: NAV Development Report - Account Schedules

    The coding was present, I just used the existing account schedule report and saved as a new report for the summary.

    Documentation()

    OnInitReport()

    OnPreReport()

    TransferValues;

    UpdateFilters;

    InitAccSched;

    OnPostReport()

    AccScheduleName - OnPreDataItem()

    SETRANGE(Name,AccSchedName);

    PageGroupNo := 1;

    NextPageGroupNo := 1;

    AccScheduleName - OnAfterGetRecord()

    CurrReport.PAGENO := 1;

    GLSetup.GET;

    IF "Analysis View Name" <> '' THEN BEGIN

     AnalysisView.GET("Analysis View Name");

    END ELSE BEGIN

     AnalysisView.INIT;

     AnalysisView."Dimension 1 Code" := GLSetup."Global Dimension 1 Code";

     AnalysisView."Dimension 2 Code" := GLSetup."Global Dimension 2 Code";

    END;

    IF UseAmtsInAddCurr THEN

     HeaderText := STRSUBSTNO(Text003,GLSetup."Additional Reporting Currency")

    ELSE

     IF GLSetup."LCY Code" <> '' THEN

       HeaderText := STRSUBSTNO(Text003,GLSetup."LCY Code")

     ELSE

       HeaderText := '';

    AccScheduleName - OnPostDataItem()

    Heading - OnPreDataItem()

    Heading - OnAfterGetRecord()

    Heading - OnPostDataItem()

    AccSchedLineSpec - OnPreDataItem()

    IF NOT ShowAccSchedSetup THEN

     CurrReport.BREAK;

    NextPageGroupNo += 1;

    AccSchedLineSpec - OnAfterGetRecord()

    IF "Row No." <> '' THEN

     LineShadowed := NOT LineShadowed

    ELSE

     LineShadowed := FALSE;

    AccSchedLineSpec - OnPostDataItem()

    PageBreak - OnPreDataItem()

    IF NOT ShowAccSchedSetup THEN

     CurrReport.BREAK;

    PageBreak - OnAfterGetRecord()

    CurrReport.NEWPAGE;

    PageBreak - OnPostDataItem()

    Acc. Schedule Line - OnPreDataItem()

    PageGroupNo := NextPageGroupNo;

    SETFILTER("Date Filter",DateFilter);

    SETFILTER("G/L Budget Filter",GLBudgetFilter);

    SETFILTER("Cost Budget Filter",CostBudgetFilter);

    SETFILTER("Business Unit Filter",BusinessUnitFilter);

    SETFILTER("Dimension 1 Filter",Dim1Filter);

    SETFILTER("Dimension 2 Filter",Dim2Filter);

    SETFILTER("Dimension 3 Filter",Dim3Filter);

    SETFILTER("Dimension 4 Filter",Dim4Filter);

    SETFILTER("Cost Center Filter",CostCenterFilter);

    SETFILTER("Cost Object Filter",CostObjectFilter);

    SETFILTER("Cash Flow Forecast Filter",CashFlowFilter);

    Acc. Schedule Line - OnAfterGetRecord()

    IF (Show = Show::No) OR NOT ShowLine(Bold,Italic) THEN

     CurrReport.SKIP;

    Bold_control := Bold;

    Italic_control := Italic;

    Underline_control := Underline;

    DoubleUnderline_control := "Double Underline";

    PageGroupNo := NextPageGroupNo;

    IF "New Page" THEN

     NextPageGroupNo := PageGroupNo + 1;

    IF "Row No." <> '' THEN

     LineShadowed := NOT LineShadowed

    ELSE

     LineShadowed := FALSE;

    Acc. Schedule Line - OnPostDataItem()

    Column Layout - OnPreDataItem()

    SETRANGE("Column Layout Name",ColumnLayoutName);

    LineSkipped := TRUE;

    Column Layout - OnAfterGetRecord()

    IF Show = Show::Never THEN

     CurrReport.SKIP;

    Header := "Column Header";

    RoundingHeader := '';

    IF "Rounding Factor" IN ["Rounding Factor"::"1000","Rounding Factor"::"1000000"] THEN

     CASE "Rounding Factor" OF

       "Rounding Factor"::"1000":

         RoundingHeader := Text000;

       "Rounding Factor"::"1000000":

         RoundingHeader := Text001;

     END;

    ColumnValuesAsText := '';

    ColumnValuesDisplayed := AccSchedManagement.CalcCell("Acc. Schedule Line","Column Layout",UseAmtsInAddCurr);

    IF AccSchedManagement.GetDivisionError THEN BEGIN

     IF ShowError IN [ShowError::"Division by Zero",ShowError::Both] THEN

       ColumnValuesAsText := Text002;

    END ELSE

     IF AccSchedManagement.GetPeriodError THEN BEGIN

       IF ShowError IN [ShowError::"Period Error",ShowError::Both] THEN

         ColumnValuesAsText := Text004;

     END ELSE BEGIN

       ColumnValuesAsText :=

         AccSchedManagement.FormatCellAsText("Column Layout",ColumnValuesDisplayed);

       IF "Acc. Schedule Line"."Totaling Type" = "Acc. Schedule Line"."Totaling Type"::Formula THEN

         CASE "Acc. Schedule Line".Show OF

           "Acc. Schedule Line".Show::"When Positive Balance":

             IF ColumnValuesDisplayed < 0 THEN

               ColumnValuesAsText := '';

           "Acc. Schedule Line".Show::"When Negative Balance":

             IF ColumnValuesDisplayed > 0 THEN

               ColumnValuesAsText := '';

           "Acc. Schedule Line".Show::"If Any Column Not Zero":

             IF ColumnValuesDisplayed = 0 THEN

               ColumnValuesAsText := '';

         END;

     END;

    IF (ColumnValuesAsText <> '') OR ("Acc. Schedule Line".Show = "Acc. Schedule Line".Show::Yes) THEN

     LineSkipped := FALSE;

    Column Layout - OnPostDataItem()

    IF LineSkipped THEN

     LineShadowed := NOT LineShadowed;

    InitAccSched()

    AccScheduleName.SETRANGE(Name,AccSchedName);

    "Acc. Schedule Line".SETFILTER("Date Filter",DateFilter);

    "Acc. Schedule Line".SETFILTER("G/L Budget Filter",GLBudgetFilter);

    "Acc. Schedule Line".SETFILTER("Cost Budget Filter",CostBudgetFilter);

    "Acc. Schedule Line".SETFILTER("Business Unit Filter",BusinessUnitFilter);

    "Acc. Schedule Line".SETFILTER("Dimension 1 Filter",Dim1Filter);

    "Acc. Schedule Line".SETFILTER("Dimension 2 Filter",Dim2Filter);

    "Acc. Schedule Line".SETFILTER("Dimension 3 Filter",Dim3Filter);

    "Acc. Schedule Line".SETFILTER("Dimension 4 Filter",Dim4Filter);

    "Acc. Schedule Line".SETFILTER("Cost Center Filter",CostCenterFilter);

    "Acc. Schedule Line".SETFILTER("Cost Object Filter",CostObjectFilter);

    "Acc. Schedule Line".SETFILTER("Cash Flow Forecast Filter",CashFlowFilter);

    EndDate := "Acc. Schedule Line".GETRANGEMAX("Date Filter");

    FiscalStartDate := AccSchedManagement.FindFiscalYear(EndDate);

    AccSchedLineFilter := "Acc. Schedule Line".GETFILTERS;

    PeriodText := "Acc. Schedule Line".GETFILTER("Date Filter");

    SetAccSchedName(NewAccSchedName : Code[10])

    AccSchedNameHidden := NewAccSchedName;

    SetColumnLayoutName(ColLayoutName : Code[10])

    ColumnLayoutNameHidden := ColLayoutName;

    SetFilters(NewDateFilter : Text[30];NewBudgetFilter : Text[30];NewCostBudgetFilter : Text[30];NewBusUnitFilter : Text[30];NewDim1Filter : Text[250];NewDim2Filter : Text[250];NewDim3Filter : Text[250];NewDim4Filter : Text[250])

    DateFilterHidden := NewDateFilter;

    GLBudgetFilterHidden := NewBudgetFilter;

    CostBudgetFilterHidden := NewCostBudgetFilter;

    BusinessUnitFilterHidden := NewBusUnitFilter;

    Dim1FilterHidden := NewDim1Filter;

    Dim2FilterHidden := NewDim2Filter;

    Dim3FilterHidden := NewDim3Filter;

    Dim4FilterHidden := NewDim4Filter;

    UseHiddenFilters := TRUE;

    ShowLine(Bold : Boolean;Italic : Boolean) : Boolean

    IF "Acc. Schedule Line"."Totaling Type" = "Acc. Schedule Line"."Totaling Type"::"Set Base For Percent" THEN

     EXIT(FALSE);

    IF "Acc. Schedule Line".Show = "Acc. Schedule Line".Show::No THEN

     EXIT(FALSE);

    IF "Acc. Schedule Line".Bold <> Bold THEN

     EXIT(FALSE);

    IF "Acc. Schedule Line".Italic <> Italic THEN

     EXIT(FALSE);

    EXIT(TRUE);

    LOCAL FormLookUpDimFilter(Dim : Code[20];VAR Text : Text[1024]) : Boolean

    IF Dim = '' THEN

     EXIT(FALSE);

    DimValList.LOOKUPMODE(TRUE);

    DimVal.SETRANGE("Dimension Code",Dim);

    DimValList.SETTABLEVIEW(DimVal);

    IF DimValList.RUNMODAL = ACTION::LookupOK THEN BEGIN

     DimValList.GETRECORD(DimVal);

     Text := DimValList.GetSelectionFilter;

     EXIT(TRUE);

    END;

    EXIT(FALSE)

    LOCAL FormGetCaptionClass(DimNo : Integer) : Text[250]

    CASE DimNo OF

     1:

       BEGIN

         IF AnalysisView."Dimension 1 Code" <> '' THEN

           EXIT('1,6,' + AnalysisView."Dimension 1 Code");

         EXIT(STRSUBSTNO(Text005,DimNo));

       END;

     2:

       BEGIN

         IF AnalysisView."Dimension 2 Code" <> '' THEN

           EXIT('1,6,' + AnalysisView."Dimension 2 Code");

         EXIT(STRSUBSTNO(Text005,DimNo));

       END;

     3:

       BEGIN

         IF AnalysisView."Dimension 3 Code" <> '' THEN

           EXIT('1,6,' + AnalysisView."Dimension 3 Code");

         EXIT(STRSUBSTNO(Text005,DimNo));

       END;

     4:

       BEGIN

         IF AnalysisView."Dimension 4 Code" <> '' THEN

           EXIT('1,6,' + AnalysisView."Dimension 4 Code");

         EXIT(STRSUBSTNO(Text005,DimNo));

       END;

    END;

    LOCAL TransferValues()

    GLSetup.GET;

    IF AccSchedNameHidden <> '' THEN

     AccSchedName := AccSchedNameHidden;

    IF ColumnLayoutNameHidden <> '' THEN

     ColumnLayoutName := ColumnLayoutNameHidden;

    IF DateFilterHidden <> '' THEN

     DateFilter := DateFilterHidden;

    IF GLBudgetFilterHidden <> '' THEN

     GLBudgetFilter := GLBudgetFilterHidden;

    IF CostBudgetFilterHidden <> '' THEN

     CostBudgetFilter := CostBudgetFilterHidden;

    IF BusinessUnitFilterHidden <> '' THEN

     BusinessUnitFilter := BusinessUnitFilterHidden;

    IF Dim1FilterHidden <> '' THEN

     Dim1Filter := Dim1FilterHidden;

    IF Dim2FilterHidden <> '' THEN

     Dim2Filter := Dim2FilterHidden;

    IF Dim3FilterHidden <> '' THEN

     Dim3Filter := Dim3FilterHidden;

    IF Dim4FilterHidden <> '' THEN

     Dim4Filter := Dim4FilterHidden;

    IF AccSchedName <> '' THEN

     IF NOT AccScheduleName.GET(AccSchedName) THEN

       AccSchedName := '';

    IF AccSchedName = '' THEN

     IF AccScheduleName.FINDFIRST THEN

       AccSchedName := AccScheduleName.Name;

    IF ColumnLayoutName <> '' THEN

     IF NOT ColumnLayoutName2.GET(ColumnLayoutName) THEN

       ColumnLayoutName := AccScheduleName."Default Column Layout";

    IF AccScheduleName."Analysis View Name" <> '' THEN

     AnalysisView.GET(AccScheduleName."Analysis View Name")

    ELSE BEGIN

     AnalysisView."Dimension 1 Code" := GLSetup."Global Dimension 1 Code";

     AnalysisView."Dimension 2 Code" := GLSetup."Global Dimension 2 Code";

    END;

    LOCAL UpdateFilters()

    IF UseHiddenFilters THEN BEGIN

     DateFilter := DateFilterHidden;

     GLBudgetFilter := GLBudgetFilterHidden;

     CostBudgetFilter := CostBudgetFilterHidden;

     BusinessUnitFilter := BusinessUnitFilterHidden;

     Dim1Filter := Dim1FilterHidden;

     Dim2Filter := Dim2FilterHidden;

     Dim3Filter := Dim3FilterHidden;

     Dim4Filter := Dim4FilterHidden;

    END;

    IF ColumnLayoutName = '' THEN

     IF AccScheduleName.FINDFIRST THEN

       ColumnLayoutName := AccScheduleName."Default Column Layout";

    ValidateAccSchedName()

    AccSchedManagement.CheckName(AccSchedName);

    AccScheduleName.GET(AccSchedName);

    IF AccScheduleName."Default Column Layout" <> '' THEN

     ColumnLayoutName := AccScheduleName."Default Column Layout";

    IF AccScheduleName."Analysis View Name" <> '' THEN

     AnalysisView.GET(AccScheduleName."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;

    Dim1FilterEnable := AnalysisView."Dimension 1 Code" <> '';

    Dim2FilterEnable := AnalysisView."Dimension 2 Code" <> '';

    Dim3FilterEnable := AnalysisView."Dimension 3 Code" <> '';

    Dim4FilterEnable := AnalysisView."Dimension 4 Code" <> '';

  • Suggested answer
    RE: NAV Development Report - Account Schedules

    Hi TraciB,

    Can you post your code or the method you tried doing it? Which will help us to get an idea in order to help you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans