Tuesday, April 16, 2024

Add new ranges for static query based report.

 

The blog addresses a requirement to update the "Mcrholdorder" report in D365FO by implementing new date ranges for certain fields. This static query-based report needs modification to accommodate the specified changes efficiently.

in my scenario i have to add a rate ranges for table "McrHoldCodeTrans" field "CreateddateTime".

 [extensionOf(classStr(MCROrderHoldController))]
public void preRunModifyContract() { Query query; SrsReportRdlDataContract contract; // get the query from contract. query = this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey()); // get the contract object. contract = this.parmReportContract().parmRdlContract(); // startDate and end date values from contract dialog. startDate = contract.getParameter(#parameterFromDate).getValueTyped(); endDate = contract.getParameter(#parameterToDate).getValueTyped(); // pass the table and field on which field we have to apply ranges on. // if we want to add or join any data source with standard static query and send the created query in the parameters. SrsReportHelper::addFromAndToDateRangeToQuery(query,startDate,endDate, TableNum(MCRHoldCodeTrans), fieldNum(MCRHoldCodeTrans, CreatedDateTime)); }


Call API using x++ D365FO

 System.Net.HttpWebRequest    request; System.Net.HttpWebResponse   response; System.IO.Stream             dataStream; System.IO.StreamReade...