Skip to main content

Notifications

Announcements

No record found.

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

How to determine Closing Entries via API

(0) ShareShare
ReportReport
Posted on by 5

We have a process where by we pull data via the API (we have written some custom AL code to give us a custom API but the issue is the same with the standard built in API) where data is queried from the "G/L Entry" table. One of the fields that we pull down is the Posting Date - when pulled by the API this comes down as a "Date" type (with no time part). The problem we are having is we cannot find a way to determine which of the line items refer to closing entries... within Dynamics they would appear with a 'C' before the date (which is missing in the API data) and when exported to Excel we can see closing entries also have a time of 23:59:59 but as no time part is pulled we cannot query this either.

I have read some threads online saying to use the SourceCode field and while this does capture many of the closing entries, there are many other closing entries that are missed...

Any advice on how to reliably determine Closing Entries (either via custom AL code or better still just from other existing fields in the API) would be greatly appreciated.

  • Louis Miles Profile Picture
    Louis Miles 5 on at
    RE: How to determine Closing Entries via API

    Unfortunately this post doesn't really help as like I said in my original question - many of the closing entries will be marked as CLSIncome in the Source Code but not all of them (I believe it depends on how the closing item was created). There must be a way in which we can guarantee if an item is a closing entry...

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: How to determine Closing Entries via API

    hi

    look this

    community.dynamics.com/.../add-g-l-entry-closing-date-to-api

    DAnieel

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