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

Send automatic email when Cash Receipt is applied or unapplied

(5) ShareShare
ReportReport
Posted on by 4,007
Please give me some general idea on how to achieve this:
When Customer Cash Receipt Journal is applied or unapplied to Invoices and Posted, send automatic email for each Invoice that was applied or unapplied.
If AL Coding is required, which Event to subscribe and modify?
 
The email message examples:
Customer: CUST01, Invoice No: INV001, Cash Receipt No: CASH001, Amount Applied: $500.00
Customer: CUST01, Invoice No: INV001, Cash Receipt No: CASH001, Amount Un-applied: $500.00
 
Thank you
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,421 Super User 2026 Season 1 on at
    Hi, Yes, this requires customization, and hopefully the following information will give you some hints.
     
     
    Thanks.
    ZHU
  • Suggested answer
    Dhiren Nagar Profile Picture
    2,880 Super User 2026 Season 1 on at
    Hi,
     
    This requires customization with AL.
     
    You might want to use 
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line",
            'OnAfterPostDtldCVLedgEntry', '', false, false)]
     
    or any other event, there are many basically.
     
    For Email you need to use Email and Email Message codeunits
     

    Tick the checkbox below to mark the answer as verified, if it helped resolve your question.

    Regards,
    Dhiren.
     
  • Suggested answer
    OussamaSabbouh Profile Picture
    11,612 Super User 2026 Season 1 on at
    Hello ,
    Hook your logic into the customer application posting engine, not the journal UI: customer apply/unapply is posted via CustPostApplyCustLedgEntry and UnapplyCustLedgEntry, both called from codeunit 226 “CustEntry-Apply Posted Entries”; subscribe to an “OnAfter…” IntegrationEvent there (one after apply post, one after unapply post), then read the Detailed Cust. Ledg. Entry rows created by that posting to identify which invoice entry was applied/unapplied, which payment/cash receipt entry did it, and the amount, and finally send one email per invoice using the standard BC Email framework (after email accounts/scenarios are set up).
     
    Regards,
    Oussama Sabbouh
  • DinB Profile Picture
    4,007 on at
    Thank you, I have added code to subscribe to "OnAfterPostApplyCustLedgEntry" then find the latest Application records in the "Detailed Cust. Ledg. Entry" table . The problem I have now is that this event runs even when doing "Preview Posting". I want to run this only during Post such as "Post Application..". How can I identify and block running the code during "Preview Posting"?
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans