Hi, Readers.
Last week we discussed how to use Word Templates in Business Central.
At the end of that post, I mentioned that Word Templates feature is also available on the Customer List, Customer Card, Vendor List, Vendor Card, Contact list, and Contact Card page by default.
![](https://yzhums.com/wp-content/uploads/2021/04/image-340.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-342-1024x451.png)
So, we can use it directly.
For example:
But, is it possible to add this feature to other pages when needed?
Yes, it’s easier than one might think.
In this post, I will share an easy example, hope it will help.
Add Word Templates to Salespersons/Purchasers (14, List):
![](https://yzhums.com/wp-content/uploads/2021/04/image-349-1024x464.png)
Source Code:
![](https://yzhums.com/wp-content/uploads/2021/04/image-354.png)
pageextension 50101 "Word Template on Salespersons" extends "Salespersons/Purchasers"
{
actions
{
addfirst(processing)
{
action(WordTemplate)
{
Caption = 'Word Template';
ToolTip = 'Apply a Word template on the selected records.';
Image = Word;
ApplicationArea = All;
Promoted = true;
PromotedCategory = Process;
trigger OnAction()
var
Salesperson: Record "Salesperson/Purchaser";
WordTemplateSelectionWizard: Page "Word Template Selection Wizard";
begin
CurrPage.SetSelectionFilter(Salesperson);
WordTemplateSelectionWizard.SetData(Salesperson);
WordTemplateSelectionWizard.RunModal();
end;
}
}
}
}
Published.
![](https://yzhums.com/wp-content/uploads/2021/04/image-352-1024x509.png)
Create a new word template for Salesperson/purchaser.
![](https://yzhums.com/wp-content/uploads/2021/04/image-351-1024x362.png)
![](https://yzhums.com/wp-content/uploads/2021/04/image-353.png)
Test video:
END
Hope this will help.
Thanks for reading.
ZHU
コメント