Hi, Readers.
Last week, I saw an interesting question in Business Central forum, when sending emails from BC, is it possible to add a user’s default signature? Such as including user name, user email, company name, etc. More details: e-mail and signatures.
As you might, in Outlook, you can create one or more personalized signatures for your email messages. Your signature can include text, links, pictures, and images (such as your handwritten signature or a logo). More details: Create and add an email signature in Outlook
And you can easily share information and documents, such as sales and purchase orders and invoices, by email directly from Business Central, without having to open an email app. For example, choose Email Confirmation… on the Sales Orders page.
If you have completed the Email Account settings, the following Email Editor page will open, which is similar to Outlook.
The Message contains the body of the email
This is what is in Outlook after sending: Of course this does not include user signature.
So is there no way for us to add it? Unfortunately, there is no way at present. But we can think about it in a different way. Let’s see more details.
First, you need to know where this default Message (layout) comes from.
For the W1 Demo database, this is the report layout set in Report Selection – Sales -> Usage (Order).
Standard Sales Order Confirmation Email (Word):
Word Layout:
More details: Dynamics 365 Business Central: Report Selection for standard documents (Set up default reports)
So here’s a simpler way to consider it. We just need to modify this layout file. Of course some values are not in standard dataitems, we need to customize the standard report using Report Extension, but this solves the problem.
For example, this time we add the current user name, email address and some fixed text.
First, add some required fields and logic through Report Extension.
Source code:
reportextension 50102 StandardSalesOrderConfExt extends "Standard Sales - Order Conf."
{
dataset
{
add(Header)
{
column(UserFullName; UserFullName)
{ }
column(UserEmail; UserEmail)
{ }
column(WarmRegards; WarmRegards)
{ }
}
}
trigger OnPreReport()
var
User: Record User;
begin
if User.Get(UserSecurityId()) then begin
UserFullName := User."Full Name";
UserEmail := User."Contact Email";
end;
end;
var
UserFullName: Text;
UserEmail: Text;
WarmRegards: Label 'Warm Regards';
}
On the Report Layouts page, select Standard Sales Order Confirmation Email (Word), and choose Update and Export Layout.
Open the exported layout (.docx) file and insert the fields you just added. You can modify the text size, font, background and other formats.
Go back to the Report Layouts page and choose New. In Add New Layout for a Report page, fill in the following fields:
Field | Description | Mandatory |
---|---|---|
Report ID | Set to the ID assigned to the report | yes |
Layout Name | Type a brief description name for the layout to help you easily identify it. | yes |
Description | Type more detailed information the layout. | no |
Format Options | Set this field to match the type of the layout, like Word, Excel, or RDLC. | yes |
Upload the layout file you just updated.
Done.
Finally, select the layout you just added in Report Selection – Sales -> Usage (Order).
A simple test:
Another user:
In outlook:
Test video:
Very simple. Give it a try!!!😁
PS: Dynamics 365 Business Central: Using Word Templates with Email
END
Hope this will help.
Thanks for reading.
ZHU
コメント