Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Trying to develop a nested api call for chart of accounts - could use some direction.

Posted on by 5

Hello, 

I am trying to create an api in laravel hitting our business central for an external site.   

In the chart of accounts, the user wants to have a view of their total balance and net change. Then, they want to be able to filter down by dimensions.  They should be able to have filter where they can toggle on a dimension, and choose a valueCode of that dimension to get the total net change and balance of ledgers containing the valueCode. 

I've been able to hit into the general ledger, per account, expanding the dimensionSetLines to see codes and valueCodes. 

It seems there isn't a way to only pull general ledger entries where the nested dimensionSetLines contains a dimension code, and a specific codeValue.  Is this something that will have to be handled after retrieving all of the general ledgers? 

Is there an easier way that I am not realizing for both of these? Right now I think I need to pull all of the accounts, then for each account, add the netChange, then, expand the trialBalance to add the balances, but if a filter is active, I grab all general ledgers per account, expand the dimensionSetLines to see the codes and filter the valueCode, and add the ledgers individually.

We also need date range filters, but that might be a battle for another day. 

Thanks

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans