Hi,
I am trying to confirm sales order through code and using print management setting to email report automatically. Here is the code below.
SRSPrintDestinationSettings = new SRSPrintDestinationSettings(confirm.printerSettingsFormletter(PrintSetupOriginalCopy::Original));
SRSPrintDestinationSettings.emailTo(email);
SRSPrintDestinationSettings.PrintMediumType(SRSPrintMediumType::Email);
SRSPrintDestinationSettings.numberOfCopies(1);
SRSPrintDestinationSettings.emailSubject(strfmt('Organogenesis, Inc. Order Confirmation PDF for %1', _salesTable.SalesId));
SRSPrintDestinationSettings.emailAttachmentFileFormat(SRSReportFileFormat::PDF);
SRSPrintDestinationSettings.overridePageSettings(true);
SRSPrintDestinationSettings.overridePrintContractSettings(true);
confirm.update(_salesTable, SystemDateGet(), SalesUpdate::All, AccountOrder::None, NoYes::Yes/*Proforma*/, NoYes::Yes);