web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

General Ledger Entries API - correlate invoice with applied payment

(0) ShareShare
ReportReport
Posted on by 25

I have a question concerning the generalLedgerEntries.  I'm fairly new to the platform and API, but have a fairly decent working knowledge of the salesInvoices, purchaseInvoices, genralLedgerEntries, etc. objects.  The goal is to pair the "applied payment" entry to the "invoice" entry.  As an example:

GeneralLedgerEntries : invoice

 

{

            "@odata.etag": "W/\"JzIwOzE1ODc2OTU5NTEyNjk3ODYxODg5MTswMDsn\"",

            "id": "5af98d17-d45e-ed11-8c37-000d3a9a8781",

            "entryNumber": 88475,

            "postingDate": "2022-11-07",

            "documentNumber": "INV-01297641",

            "documentType": "Invoice",

            "accountId": "2a60a57a-3d01-ed11-82f8-002248348c2a",

            "accountNumber": "40510",

            "description": "Invoice INV-01297641",

            "debitAmount": 0,

            "creditAmount": 208.1,

            "lastModifiedDateTime": "2022-11-07T19:41:03.557Z"

        },

        {

            "@odata.etag": "W/\"JzE5OzY4MTg0NjU4MjM1MzcwNTA2NjMxOzAwOyc=\"",

            "id": "5bf98d17-d45e-ed11-8c37-000d3a9a8781",

            "entryNumber": 88476,

            "postingDate": "2022-11-07",

            "documentNumber": "INV-01297641",

            "documentType": "Invoice",

            "accountId": "1760a57a-3d01-ed11-82f8-002248348c2a",

            "accountNumber": "20019",

            "description": "Invoice INV-01297641",

            "debitAmount": 0,

            "creditAmount": 20.81,

            "lastModifiedDateTime": "2022-11-07T19:41:03.557Z"

        },

        {

            "@odata.etag": "W/\"JzIwOzE1MzM3MDU5Nzg4ODU2MzYxOTQ1MTswMDsn\"",

            "id": "5ef98d17-d45e-ed11-8c37-000d3a9a8781",

            "entryNumber": 88477,

            "postingDate": "2022-11-07",

            "documentNumber": "INV-01297641",

            "documentType": "Invoice",

            "accountId": "f75fa57a-3d01-ed11-82f8-002248348c2a",

            "accountNumber": "10101",

            "description": "Invoice INV-01297641",

            "debitAmount": 228.91,

            "creditAmount": 0,

            "lastModifiedDateTime": "2022-11-07T19:41:03.57Z"

        }

Ties to:

generalLedgerEntries : payment

 

       {

            "@odata.etag": "W/\"JzE5Ozk4MzI2Mjk1NjA0NTg2OTI0ODYxOzAwOyc=\"",

            "id": "80659bdb-636f-ed11-8c34-0022482d7230",

            "entryNumber": 155942,

            "postingDate": "2022-11-25",

            "documentNumber": "900541129_2",

            "documentType": "Payment",

            "accountId": "f15fa57a-3d01-ed11-82f8-002248348c2a",

            "accountNumber": "10004",

            "debitAmount": 20598.39,

            "creditAmount": 0,

            "lastModifiedDateTime": "2022-11-28T21:30:23.973Z"

        },

        {

            "@odata.etag": "W/\"JzE5OzQ1NDA4MjI1MTMyODI1NTM2MzcxOzAwOyc=\"",

            "id": "81659bdb-636f-ed11-8c34-0022482d7230",

            "entryNumber": 155943,

            "postingDate": "2022-11-25",

            "documentNumber": "900541129_2",

            "documentType": "Payment",

            "accountId": "f75fa57a-3d01-ed11-82f8-002248348c2a",

            "accountNumber": "10101",

            "debitAmount": 0,

            "creditAmount": 20598.39,

            "lastModifiedDateTime": "2022-11-28T21:30:23.973Z"

        }

 I can see this in the application, so what object allows me to call those together in the API?  
pastedimage1670961610337v1.png

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    This can probably only work via a custom API:

    learn.microsoft.com/.../devenv-develop-custom-api

    If you do not have experience with development, best is to ask your partner to help you with this.

    Thank you.

  • Verified answer
    bgrannis Profile Picture
    25 on at

    Hi Marco,

    I appreciate the feedback.  I believe I have resolved the issue.  A new extension is needed to be built and published to the Business Central instance.

    The Page.al files that need to be build are for the “Cust. Ledger Entry” and “Detailed Cust. Ledg. Entry” tables.  Through investigation, it appears that the Detail table contains a “AppliedCustLedgerEntryNo” field for the payment.   This number associates back to the “Cust. Ledger Entry” table through a field called “ClosedbyEntryNo” which corresponds to the invoice.

    I’ve built and packaged the extension and published it to the instance.  It is working as expected.  I hope this helps anyone needing this functionality.

    Regards,

    Bill

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans