Modify Email Subject for a report in D365 F&O from x++
public void printReport()
{
if (reportContract.parmRdpName() == "ProjInvoiceDP") //Dp classs name
{
ProjInvoiceContract contract = reportContract.parmRdpContract() as PSAProjInvoiceContract;
ProjInvoiceJour invoiceJournal;
select firstonly * from invoiceJournal where invoiceJournal.RecId == contract.parmProjInvoiceJourRecId(); //Get the which field we need to add in subjcet
printSettings.emailSubject(strFmt(" %1", invoiceJournal.ProjInvoiceId));
printSettings.fileFormat(SRSReportFileFormat::PDF);
printSettings.fileName(strFmt("SAProjInvoiceModern.Report")); //attached file output
}
next printReport();
}