Hi All,
Can we able to change the invoice No. in the Subject field of the action Send by Email in posted sales invoice, here for me the invoice No. is coming correctly, but i don't want the starting numbers Upto "100-" how can we achieve this through al code, is there any possible way to achieve this through code or we have to manually change the number only, I am attaching a screenshot of it. advance thanks for your advices.
Thanks & Regards
Satish.
You could automate these parts of business central with power automate and with much more freedom to customize stuff like the subject.
Hi, hope the following helps.
How to change default subject of the email when sending mail in Dynamics 365 Business Central – Customization
Thanks.
ZHU
Hi,
Yes you can try below code, this is for example, you can replace your values by External document no. in the below function.
local procedure OnBeforeGetEmailSubject(PostedDocNo: Code[20]; EmailDocumentName: Text[250]; ReportUsage: Integer; var EmailSubject: Text[250]; var IsHandled: Boolean) var SalesInvoiceHeader: Record "Sales Invoice Header"; CompanyInformation: Record "Company Information"; EmailSubjectCapTxt: Label '%1 - %2 %3, %4', Comment = '%1 = Customer Name. %2 = Document Type %3 = Invoice No.'; begin if SalesInvoiceHeader.get(PostedDocNo) then begin CompanyInformation.get; EmailSubject := StrSubstNo(EmailSubjectCapTxt, CompanyInformation.Name, 'Sales Invoice', SalesInvoiceHeader."No.", SalesInvoiceHeader."External Document No."); IsHandled := true; end; end;
You can use OnBeforeGetEmailSubject and return the subject as you want.
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,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156