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...
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,708 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,708 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,037 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,708 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

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,010

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans