action(APTPVC_SendPriceList)
{
Caption = '&Send Email ';
Image = Email;
Ellipsis = true;
ToolTip = 'Prepare to send the Sales Price Lists. A report request window for the document opens where you can specify what to include on the email.';
Promoted = true;
PromotedCategory = Report;
trigger OnAction()
var
PriceListLine: Record "Price List Line";
CustomReportSelection: Record "Custom Report Selection";
CustomLayoutReporting: Codeunit "Custom Layout Reporting";
RecRef: RecordRef;
begin
RecRef.Open(Database::"Price List Line");
CustomLayoutReporting.SetOutputFileBaseName(StatementFileNameTxt);
CustomReportSelection.SetRange(Usage, "Report Selection Usage"::"S.PriceList");
if CustomReportSelection.FindFirst() then
CustomLayoutReporting.SetTableFilterForReportID(CustomReportSelection."Report ID", PriceListLine."Assign-to No.")
else
CustomLayoutReporting.SetTableFilterForReportID(Report::APTPVC_SalesPriceList, PriceListLine."Assign-to No.");
CustomLayoutReporting.ProcessReportData(
"Report Selection Usage"::"S.PriceList", RecRef, PriceListLine.FieldName("Assign-to No."),
Database::"Price List Line", PriceListLine.FieldName("Assign-to No."), true);
end;
}