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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

API - Use of filter on Trial Balance

(0) ShareShare
ReportReport
Posted on by 5

Hi

On https://docs.microsoft.com/en-us/dynamics-nav/api-reference/v1.0/api/dynamics_trialbalance_get

it says that you can filter the results using

GET https://{businesscentralPrefix}/api/v1.0/companies({id})/trialBalance?$orderby number&$filter=dateFilter ge 2019-01-01 and dateFilter le 2019-12-31

It seems to me that the filter will not apply, so the results always will be today.

I am trying to extraxt the opening balance for each balance account for each year...
I have the same question (0)
  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    This may be data related, but also I see that there is some logic on this API to calculate amounts. But for me at least the data is different. First I run it without a date filter:

    https://api.businesscentral.dynamics.com/v2.0/12345a290c-abcde-4e49-afcb-daf662adc134/Production/api/v1.0/companies(0f8058e0-affd-ea11-bb48-000d3a2fece2)/trialBalance?$orderby number

    pastedimage1619085211939v1.png

    For account 10200, BalanceAtDateCredit is 428,888.90.

    Then I apply the filter:

    https://api.businesscentral.dynamics.com/v2.0/12345a290c-abcde-4e49-afcb-daf662adc134/Production/api/v1.0/companies(0f8058e0-affd-ea11-bb48-000d3a2fece2)/trialBalance?$orderby number&$filter=dateFilter ge 2019-01-01 and dateFilter le 2019-12-31

    pastedimage1619085333383v2.png

    Now the balance is 313,421.50

    So the filter has an effect at least. I guess only for the "balanceAtDate"-fields. At least that's how it looks on my setup. I don't know if that helps you - of course it does not help you that it works for me if it doesnt work for you?

  • HavardLein Profile Picture
    5 on at

    Thanks for the reply!

    Do you get the same results when using version 1.0 of the API too?

    We cannot access the customers data through v2.0...

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    Yep, this was with 1.0 API. I also could not get to it with 2.0, I guess its has been updated, maybe as per this doc:

    docs.microsoft.com/.../dynamics_trialbalance

  • HavardLein Profile Picture
    5 on at

    Hmmm..

    I get results posting this:

    $orderby number&$filter=dateFilter ge 2019-01-01 and dateFilter le 2021-12-31

    However when posting this

    $orderby number&$filter=dateFilter ge 2019-01-01 and dateFilter le 2021-01-31

    I dont get any results.

    Cannot make much sence to this :-)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans