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

Auto-Apply in customer ledger entries in Business Central

(4) ShareShare
ReportReport
Posted on by 12
Hi,
 
How to control auto apply of sales invoices in customer ledger entries through configuration or events in business central. Kindly help me on this. 
 
Thanks in advance
I have the same question (0)
  • ArchitectMadhan Profile Picture
    458 on at

    To control the auto-application of sales invoices in customer ledger entries in Dynamics 365 Finance and Operations (D365 F&O), you can use configuration settings and event handling. Here are the steps to achieve this:

    Configuration Settings

    1. Navigate to Accounts Receivable Parameters:

      • Go to Accounts receivable > Setup > Accounts receivable parameters.
    2. Set Auto-Apply Parameters:

      • In the Accounts receivable parameters form, find the Settlement tab.
      • Adjust the settings for Automatic settlement to control how invoices are automatically applied to customer payments.

    Using Event Handling

    1. Create a New Class for Event Handling:

      • In Visual Studio, create a new class to handle the events related to customer transactions.
    2. Subscribe to the Relevant Events:

      • Subscribe to events such as CustTrans.OnInsert or CustTrans.OnUpdate to control the behavior when sales invoices are created or updated.
    3. Implement Custom Logic:

      • In your event handler methods, implement the logic to control the auto-application of sales invoices. For example, you can add conditions to determine when invoices should be automatically applied.

    Here is a basic example of how you might set up an event handler in X++:

    [EventHandlerFor(tableStr(CustTrans), tableMethodStr(CustTrans, insert))]
    public static void CustTrans_OnInsert(Common sender, DataEventArgs e)
    {
        CustTrans custTrans = sender as CustTrans;
        if (custTrans)
        {
            // Custom logic to control auto-application
            if (custTrans.TransType == CustTransType::Invoice)
            {
                // Example condition to prevent auto-application
                if (custTrans.AmountCur > 1000)
                {
                    custTrans.AutoApply = NoYes::No;
                }
            }
        }
    }
    

    By combining these configuration settings and custom event handling, you can effectively control the auto-application of sales invoices in customer ledger entries.

    If you find this solution useful, please like it and accept it as answer.


    -ArchitectMadhan

  • SM-10031500-0 Profile Picture
    12 on at
    Thanks for the details.... If possible, can you please help me on business central.
  • Martin Dráb Profile Picture
    237,996 Most Valuable Professional on at
    Moved from Integration, Dataverse, and general topics forum.
     
    Ignore ArchitectMadhan, he's one of the users spamming this forum with useless AI-generated replies.
  • Verified answer
    Ramiz Profile Picture
    597 on at
    Hi,

    On Sales document you can use Payment Method Code field. By filling the Bal.Account No on payment  method it will automatically apply a payment against customer ledger entry on posting.






  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,971 Super User 2025 Season 2 on at

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 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans