Skip to main content

Notifications

Announcements

No record found.

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.

      

  • Suggested answer
    rostad.exe Profile Picture
    rostad.exe 60 on at
    RE: posted sales invoice Send by Email action

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

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    RE: posted sales invoice Send by Email action

    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
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: posted sales invoice Send by Email action

    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
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: posted sales invoice Send by Email action

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans