Skip to main content

Notifications

Community site session details

Community site session details

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

What filter values to use when calling G/L Balance by Dimension over OData on Business Central OnPrem

(0) ShareShare
ReportReport
Posted on by 5

Hi

I'm trying to get general ledger data by dimension using the OData interface on an OnPrem BC instance.

I've published page 408 "G/L Balance by Dimension" as a web service called GL_Balance_by_Dimension.

I'm using the REST client extension in VSCode to execute my call with the relevant url, tenant and company parameters filled in:

@rows = 'G/L Account'
@cols = 'Period'
GET https://{{url}}:18143/{{tenant}}/ODataV4/Company({{company}})/GL_Balance_by_Dimension?$filter=LineDimCode eq {{rows}} and ColumnDimCode eq {{cols}} HTTP/1.1
Authorization: Basic {{user}} {{wak}}
Content-Type: application/json

{
}

I only ever get an empty array returned:

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/json; odata.metadata=minimal
Content-Encoding: gzip
Server: Microsoft-HTTPAPI/2.0
OData-Version: 4.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Date, Content-Length, Server, OData-Version
request-id: 2b81c6fb-bc03-42f1-bee6-b77c1fb9229c
Date: Wed, 14 Dec 2022 11:47:47 GMT
Connection: close

{
"@odata.context": "https://*url*:18143/*tenant*/ODataV4/$metadata#Company(*company*)/GL_Balance_by_Dimension",
"value": []
}

I've tried to pass in more of the properties and filters specified in the metadata without a change in the results.

I suspect that the values I use in the LineDimCode and ColumnDimCode property filters are incorrect but I can't find what other values I can use. These are values that work if I run the page in GUI.

BTW - To verify my approach I have tried setting up, calling and filtering Chart_of_Accounts - that works as expected.

Where can I find the correct values for the properties in the $filter to use when executing a call to GL_Balance_by_Dimension?

Many thanks

Thorbjorn

  • Thorbjorn Njalsson Profile Picture
    5 on at
    RE: What filter values to use when calling G/L Balance by Dimension over OData on Business Central OnPrem

    Thank you ZHU.

  • Verified answer
    YUN ZHU Profile Picture
    84,555 Super User 2025 Season 1 on at
    RE: What filter values to use when calling G/L Balance by Dimension over OData on Business Central OnPrem

    Hi, If you open this page directly on BC, it will also display a null value. So it is also a null value when Odata accesses. Its logic is on the action before the page is opened.

    So you can't use this page, you can only customize a new page.

    pastedimage1671150466584v1.png

    pastedimage1671150488360v2.png

    pastedimage1671150502140v3.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    DAnny3211 Profile Picture
    9,278 Moderator on at
    RE: What filter values to use when calling G/L Balance by Dimension over OData on Business Central OnPrem

    hi

    look this

    learn.microsoft.com/.../dynamics_account_get

    DAniele

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans