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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Apply to Oldest applied payment to newer invoice instead of older open invoice

(3) ShareShare
ReportReport
Posted on by 10
Hello,
I am investigating payment application behavior in Dynamics 365 Business Central and would like to understand how "Apply to Oldest" determines which invoice receives a payment.
 
Customer setup:
- Application Method = Apply to Oldest
 
Open invoices before payment:
Invoice PSI-26-13827
- Posting Date: 7/28/2026
- Due Date: 8/27/2026
- Amount: 7,769.00
Invoice PSI-26-14110
- Posting Date: 8/11/2026
- Due Date: 8/11/2026
- Amount: 19,018.00
 
Test:
- Posted payment WT-10335 for $200 through Cash Receipt Journal
- Posted payment WT-10336 for $100 through Cash Receipt Journal
- No manual applies-to document was specified
 
Result:
- Both payments were automatically applied to invoice PSI-26-14110
- Invoice PSI-26-13827 remained open
- Detailed Customer Ledger Entries confirm WT-10335 and WT-10336 were applied to PSI-26-14110
 
Additional investigation:
- PSI-26-13827 has no application entries
- I reviewed one of our customization codeunits and found nothing affecting customer payment application logic
 
Question:
When Application Method = Apply to Oldest, what field does standard Business Central use to determine the oldest open invoice?

- Posting Date?
- Due Date?
- Entry No.?
- Another field?
 
In my example, the invoice selected by Business Central has a later Posting Date but an earlier Due Date, so I am trying to determine whether Due Date influences the automatic application logic.
 
Thank you.
  • Suggested answer
    Ahmad Subhani Profile Picture
    850 on at

    Hi, As per my knowledge

    Due Date. Standard BC's "Apply to Oldest" logic sorts open customer ledger entries by Due Date (ascending) and applies payments to the entry with the earliest Due Date first, not Posting Date, and not Entry No.

    In your case, PSI-26-14110 has the earlier Due Date (8/11/2026) versus PSI-26-13827 (8/27/2026), even though PSI-26-13827 was posted first. That's why both payments went to PSI-26-14110, the result is consistent with standard behavior, not a defect.

    If you found this helpful, please verify the answer so that it can benefit others as well.

    Best Regards,
    Ahmad Subhani
    Business Central Consultant
    Website - https://ahmad365.com/

  • Suggested answer
    OussamaSabbouh Profile Picture
    20,124 Super User 2026 Season 2 on at

    Hello,

    Yes, in standard Business Central Apply to Oldest is driven primarily by the Customer Ledger Entry Due Date, not the Posting Date. That explains your result exactly: PSI-26-14110 has Due Date 08/11/2026, which is earlier than PSI-26-13827 with Due Date 08/27/2026, so both payments are automatically applied to PSI-26-14110 even though its Posting Date is later. Microsoft documents that when Application Method = Apply to Oldest, BC automatically applies payments to the oldest open entry unless you manually specify an Applies-to entry; therefore, if your business considers “oldest” to mean Posting Date instead of Due Date, you would need to use Manual application or customize the selection logic.
    Regards,
    Oussama Sabbouh

  • Suggested answer
    YUN ZHU Profile Picture
    103,644 Super User 2026 Season 2 on at

    This issue has been discussed on this community forum before, which I hope offers some helpful insights.

    Apply to Oldest

     

    Thanks

    ZHU

  • Suggested answer
    AndrewThomas81 Profile Picture
    3,013 Super User 2026 Season 2 on at

    Apply to oldest with apply based on due date

     

    Kind Regards

     

    Andrew Thomas FCCA MCP

    YouTube - Use Business Central

    LinkedIn

  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    3,638 Super User 2026 Season 2 on at

    Hi, thanks for posting the stack, that changes things. Everything in it is base app, the Dataverse table builder and the wizard itself, nothing of yours in there, so at least you can stop looking your own code.

    Reading it, when you hit Finish and it builds the field mappings it ends up in UpdateExistingTable on the Dataverse table builder. That part is meant for tables BC generates in Dataverse itself, and it wants the generation to be running first, which is exactly what the message complains about. So if the table you picked is one of the BC generated ones, go to Dataverse Connection Setup, start the generation there, then come back to the wizard.

    If it is a plain table like Account, that code has no business running at all and I'd call it a bug on 28.4. You already have session and telemetry ids, that's enough for Microsoft.

  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    3,638 Super User 2026 Season 2 on at

    Hi. It is the Due Date that decides, not the Posting Date. Apply to Oldest looks at the customer's open entries in due date order and grabs the first one it finds, so 14110 due 11/08 sits in front of 13827 due 27/08, even if it was posted two weeks later. Your customisation is innocent here.

    Most likely the July invoice picked up different payment terms, or somebody touched the due date on the document. 

    If two entries share the same due date I think it follows the entry order.

    And if the business really wants oldest by posting date, standard won't give you that, it is either fixing the terms or applying by hand.

    Glad to help - follow up if anything is unclear.   

    ►  If this solved it, marking it verified helps others too.       

    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 750 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 534 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 287 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans