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

Passing Default Report parameter for sending the email in Business central

(0) ShareShare
ReportReport
Posted on by 244

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,

I have the same question (0)
  • Suggested answer
    NAV_with_Narang Profile Picture
    2,294 Moderator on at

    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

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 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans