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.