web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

AL filter transaction vs budget

(0) ShareShare
ReportReport
Posted on by

Dear All,

Am checking the budget before entering a transaction completely. I have two budget because I have two open years. I would like any transaction using posting date to check its corresponding budget based on the year. i.e. each transaction should be validated by it's budget posting date and budget year playing the key role respectively. Each transaction shouldn't go past amount if the amount is greater than budgeted amount in the respective GL account.

My biggest problem is how a transaction of year A will check the budget of year A while a transaction of year B will check the budget of year B since I have two open years.

I am not sure whether SetRange or SetFilter will help me out on this.

Kindly assist.

  • Bilal Haider Profile Picture
    487 on at

    How you are differentiating the transactions between year A and year B?

  • Romryan Profile Picture
    on at

    Bilal,

    Using posting date.

  • Suggested answer
    JAngle Profile Picture
    159 on at

    Done something similar to control purchase spend. I used setrange with calculated values where necessary to determine the range. For a monthly based budget check I used: GLBudgetEntry.SetRange(Date, CalcDate('<-CM>', WorkDate()), CalcDate('<+CM>', WorkDate()));

    Replaced CM with CY for a yearly check. I found having an “active” budget easier from a comparison point of view. I’d be careful using posting date as it’s a static date value and you might miss out other purchases that have taken place. So it the posting date is 01/06 but it’s now 15/06 and I’ve pushed through other purchases you may have depleted the budget

  • Suggested answer
    Kenneth Ariel Chaves Herrera Profile Picture
    Microsoft Employee on at

    Hi Romryan, I think this documentation can be useful for solving the issue:

    SETFILTER Function (Record) - Dynamics NAV | Microsoft Docs

    SETRANGE Function (Record) - Dynamics NAV | Microsoft Docs

    If this answers your question, please check it as verified.

    Welcome to this amazing community.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 741 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 514 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 336 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans