Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Data Not Getting Displayed when Given Range

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I have added 1 field on Request Page for selecting G/L account . When i give single Account it works fine. In Range it does not work

G/L Account - OnPreDataItem()
"G/L Account".SETRANGE("G/L Account"."No.",GLAccountNo);

G/L Account - OnAfterGetRecord()
OpgBalance := 0;
Balance := 0;

G/L Account - OnPostDataItem()

G/L Entry - OnPreDataItem()
SETRANGE("Posting Date", 0D, ToDate);

G/L Entry - OnAfterGetRecord()
IF "G/L Entry"."Posting Date" < FrDate THEN BEGIN
  OpgBalance += "G/L Entry".Amount;
  Balance += "G/L Entry".Amount;
END;

IF "G/L Entry"."Posting Date" < FrDate THEN
  CurrReport.SKIP
ELSE
  Balance += "G/L Entry".Amount;


Thanks

*This post is locked for comments

  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at
    RE: Data Not Getting Displayed when Given Range

    Check this link for better understanding of setrange and setfilter

    msdn.microsoft.com/.../dd354955.aspx

  • jsshivalik Profile Picture
    3,099 on at
    RE: Data Not Getting Displayed when Given Range

    Hi

      Why Setfilter , not SetRange

    Thanks

  • Verified answer
    mmv Profile Picture
    11,469 on at
    RE: Data Not Getting Displayed when Given Range
    G/L Account - OnPreDataItem()
    "G/L Account".SETRANGE("G/L Account"."No.",GLAccountNo);

    It has to be changed to

    G/L Account - OnPreDataItem()
    "G/L Account".SETFILTER("G/L Account"."No.",GLAccountNo);

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans