Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I am adding several reports to the SRSReportServerWarmup class to help speed up reports that are run [nearly] every day. One of the reports requested to be added to the warmup list is the Purchase receiving log report (VendPurchReceivingLog_NA). This report has no RDP, so I copied the "runSampleRdlReportWithParameters" method, as I want to add a value to the Delivery Date parameter and run it for the past 30 days. However, this report runs from a view, which pulls from a query that has the DeliveryDate and PurchId dragged into the Range field, which automatically pulls these to the front when running the report for a user to select. While the fields are displayed for entry, they are not hard-fast "parameters". They are included in the AX Dynamic parameter "VendPurchReceivingLog_DynamicParameter".
So, using the provided sample code:
// Set any required parameter values here by first getting the report contract.
contract = controller.parmReportContract();
// And then fill in that contract based on the contract type (Rdl or Rdp)
// Create the Rdl contract and set parameter values
rdlDataContract = contract.parmRdlContract();
...how can I add in my DeliveryDate parameter into the dynamic parameter?
After some research and trial & error, I've found a solution. You can add dynamic parameter values to a report in X++ using the method below. It can be pasted into the SRSReportServerWarmup Class to be used like the other 'runSample' methods. Just copy the code and replace the appropriate fields under the "// Retrieve the query map and set dynamic parameter values" section. Note that if the datasource is not found on the query the report will still execute with no parameters. Handling this situation could vary by report, so handle it on a per-report basis.
/// Sample method for running a simple report (non-RDP) that requires dynamic parameter values.
/// Use this method as a template for "warming-up" any simple SQL Server Reporting Services report.
public void runSampleReportWithDynamicParameters()
// Create a controller to run the report.
SrsReportRunController controller = new SrsReportRunController();
// set the report name and design to be run
// suppress the parameter dialog as this is to be run by the batch service
// choose to save the executed report as a pdf file
reportFilePath = System.IO.Path::Combine(this.getTempPath(), 'SampleReportName.DesignName' + #FileExtensionPDF);
// Retrieve the query map and set dynamic parameter values
queryContracts = contract.parmQueryContracts();
meQueryContracts = queryContracts.getEnumerator();
currentQuery = meQueryContracts.currentValue();
dataSource = currentQuery.dataSourceName("VendPurchReceivingLog_NA");
.value(date2StrXpp(systemDateGet()) + '..'
+ date2StrXpp(DateTimeUtil::date(DateTimeUtil::addDays(DateTimeUtil::utcNow(), -30))));
// run the report
Business Applications communities