Skip to main content

Notifications

Community site session details

Community site session details

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

Passing Default Report parameter for sending the email in Business central

(0) ShareShare
ReportReport
Posted on by 186

Dear members,

I would like to know how to pass the parameters for a default value while sending a email with attachment (Report) in business central. Currently, my email sending process gets failed when I am trying to send the email.

Please do suggest me the best way to pass the parameters for a default value.

Thanks in advance,

  • Suggested answer
    NAV_with_Narang Profile Picture
    2,246 Moderator on at
    RE: Passing Default Report parameter for sending the email in Business central

    There are a couple of ways you can do that, Passing values through functions, passing values through SETTABLEVIEW if these values are table fields or can also pass values through a XML Formatted string in the request page

    Scenario 1

    If your report filters are all table fields, suggest you to use the below in your code

    SETRANGE

    SETRANGE

    REPORT.SETTABLEVIEW

    REPORT.RUN

    Scenario 2

    If the report request page parameters are variables instead of table fields, Create a global function on the report you'd like to be attached as PDF in the Email. Make sure this function has all the request page global variables on the left side of the assignment and all your function parameters on the right side, much like:

    pastedimage1685015848966v1.png

    Now from the email batch report you have created, which attaches the above report as PDF, you can write the code as:

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans