Skip to main content



No record found.

Business Central forum

Get invoices of payment using AL

Posted on by 4
Hi Community, 
I creating a page extension in Bank Ledger entries where i created a action button. the button supposed to get the invoices applied to the selected line and will use the info of the invoice/s to add a line in a custom table. the problem is, the code i did manage to capture the information of the invoice only if there is only one invoice applied to the transaction. if the transaction has more than 1 invoices applied to it, for some reason the code only read one of the invoice. How can i capture the information of all the invoices applied.
this is the code of the function that im currently using for testing:
        VLE: Record /Vendor Ledger Entry/;
        DVLE: Record /Detailed Vendor Ledg. Entry/;
        Comment: text;
        VLE.Get(Rec./Entry No./ + 1);
        DVLE.SetFilter(/Applied Vend. Ledger Entry No./, '%1', VLE./Entry No./);
        DVLE.SetFilter(/Vendor Ledger Entry No./, '<>%1', VLE./Entry No./);
        if (DVLE.FindSet()) then
                message('Doc No: %1', DVLE./Document No./);
            until DVLE.Next() = 0;
The function supposed to supposed to popup several message showing the document no of the of the invoices depending by the number of invoice applied to it. but this only showed 1 invoice eventhough there supposed to be more than 1. Please Assist
  • gdrenteria Profile Picture
    gdrenteria 5,038 Super User on at
    Get invoices of payment using AL
    This report is likely to give you some ideas.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans