I tried to change the Subject of Notification email as below
Thanks
Thanks Yadav,
Your code worked well.
No Problem.
which version of BC are you using?
Latest BC version MailSubject also as a parameter for the above subscriber
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Notification Entry Dispatcher", 'OnBeforeCreateMailAndDispatch', '', false, false)]
local procedure OnBeforeCreateMailAndDispatch(var NotificationEntry: Record "Notification Entry"; var MailSubject: Text; var Email: Text; var IsHandled: Boolean);
begin
MailSubject := 'Custom mail subject';
end;
I am sorry to let you misunderstand.
I'd like to change subject of Approval email not sending document function
you have to know the report usage value of each document type.
Ex: 6 means Purchase Order.
You can find them in enum 77 "Report Selection Usage"
This code should change the email subject of the Purchase Order
codeunit 50100 MyNotificationDispatcher
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Document-Mailing", 'OnBeforeGetEmailSubject', '', false, false)]
local procedure OnBeforeGetEmailSubject(PostedDocNo: Code[20]; EmailDocumentName: Text[250]; ReportUsage: Integer; var EmailSubject: Text[250]; var IsHandled: Boolean);
begin
if ReportUsage = 6 then begin
EmailSubject := '6 - New Email Subject';
IsHandled := true;
end;
end;
}
I'd like to change: Purchase Order, Purchase Invoice, General Journal, Payment Journal, and some other forms of Third Party.
For which documents are you trying to change?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156