Hi Community,
I have a problem in how I can to assigned a sales quote template in attachment PDF action:
This is my scenario:
I am using two templates in sales quote, the last one is the template that now is attachment PDF for default:
I created other button similar attach pdf, but my inquiry is how I can do to assign this specific template "Quote Long Description" to the new button.
This is my code:
action(AttachAsPDF2)
{
ApplicationArea = Basic, Suite;
Caption = 'Attach as PDF LongDesc';
//Enabled = IsCustomerOrContactNotEmpty;
Image = PrintAttachment;
ToolTip = 'Create a PDF file and attach it to the document.';
Promoted = true; // add prometed area
PromotedCategory = Category9; // add prometed category
Visible = true;
trigger OnAction()
var
SalesHeader: Record "Sales Header";
begin
ClearLastError();
Commit();
CurrPage.SetSelectionFilter(Rec);
SalesHeader := Rec;
SalesHeader.SetRecFilter();
DocPrint.PrintSalesHeaderToDocumentAttachment(SalesHeader);
end;
}
If you know how I can fix it, I will appreciate.
Thank you