web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

how to add new send email functionality?

(0) ShareShare
ReportReport
Posted on by

I have added new action send email in the job card .

  • when sending this email I need attach a custom report , there is already a action send email for job order  I made a duplicate of this and now i need to change the attachment .
  • I have extended report selections usage and added the a new usage and added my report in the pages and table(report selections job)
  • how can i change the the attachment???
  • is there any event subscriber for that any idea??
I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Can you please share you code what you have tried till now?

    Thanks.

  • Community Member Profile Picture
    on at
    This is my codeunit :
        trigger OnRun()
        begin

        end;

        procedure EmailSalesHeader(job: Record "Job")
        begin
            DoPrintSalesHeader(job, true);
        end;

        local procedure DoPrintSalesHeader(job: Record Job; SendAsEmail: Boolean)
        var
            ReportSelections: Record "Report Selections";
            ReportUsage: Enum "Report Selection Usage";
            IsPrinted: Boolean;
        begin
            ReportUsage := GetSalesDocTypeUsage();
            job.SetRange("No.", job."No.");
            if IsPrinted then
                exit;

            if SendAsEmail then
                ReportSelections.SendEmailToCust(
                    ReportUsage.AsInteger(), job, job."No.", job.Description, true, job."Bill-to Customer No.", 0)
            else
                ReportSelections.PrintForCust(ReportUsage, job, job.FieldNo("Bill-to Customer No."));
        end;

        procedure GetSalesDocTypeUsage() ReportSelectionUsage: Enum "Report Selection Usage"
        var
            ReportSelections: Record "Report Selections";
            TypeUsage: Integer;
            IsHandled: Boolean;
        begin

            exit(ReportSelections.Usage::"JC") //here i have assigned the report selection
        end;

    //but still taking the standard report. where i went wrong? Nitin Verma 
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    You need to attached the correct report in the report selection page first, and then please try again,

    Go to Report Selection - Job

    Thanks.

  • Community Member Profile Picture
    on at

    In the report selection page for job

    usage is marked correctly, and selected the correct layout of the report still it is taking the standard report.

  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    Hi

    Pls check Open the Report selection page and check the Report ID.

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Community Member Profile Picture
    on at

    pastedimage1663848444059v1.png

    Report selection is all done properly but still it is taking the standard.

    is there any way by coding we can directly assign  the required report ??

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

    Hi,

    Go to the Replay Layout > Search Your report > Replace Layout by importing the correct layout > Set as default.

    pastedimage1663903748378v1.png

    Thanks.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 621 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 445 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 366 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans