Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    bgrannis Profile Picture
    bgrannis 25 on at
    RE: General Ledger Entries API - correlate invoice with applied payment

    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

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: General Ledger Entries API - correlate invoice with applied payment

    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.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,514 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans