Skip to main content

Notifications

Announcements

No record found.

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

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

(0) ShareShare
ReportReport
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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans