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

posted sales invoice Send by Email action

(0) ShareShare
ReportReport
Posted on by 50

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.

pastedimage1686570577815v2.png

Thanks & Regards

Satish.

      

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    60,999 Super User 2025 Season 2 on at

    You can use OnBeforeGetEmailSubject and return the subject as you want.

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    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;

  • Verified answer
    YUN ZHU Profile Picture
    95,548 Super User 2025 Season 2 on at

    Hi, hope the following helps.

    How to change default subject of the email when sending mail in Dynamics 365 Business Central – Customization

    https://yzhums.com/34909/

    Thanks.

    ZHU

  • Suggested answer
    rostad.exe Profile Picture
    60 on at

    You could automate these parts of business central with power automate and with much more freedom to customize stuff like the subject.

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 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans