Wednesday, May 17, 2023

Word Document Template in Dynamics 365

Q. How to create Word / Document Templates in Dynamics 365 | Power platform?

In this blog/video, we are going to see how to create a Word or document template in Dynamics 365


Email Templates in Dynamics 365 link here
Microsoft Word makes it easy to create nice-looking documents for your Dynamics 365 data. You can create templates with a consistent design and style, and share them with others. This means that all the documents you send to customers will have the same professional appearance that represents your organization. When you're ready to generate a document, you can do it with a single click, and the information from Dynamics 365 will automatically fill in the right places in the document.

With Word templates, you can easily create and share your template with others, so all the documents that go out to your customers have a consistent look that matches your organization's branding.

In Dynamics 365, document templates generate standardized documents such as invoices, quotes, purchase orders, reports, or other business documents. These templates provide a consistent format and layout for the generated documents. 

There are two types of Word templates: 
1. Personal Word Templates: Personal Word templates are specific to individual users and are used for personal or private purposes. Each user manages their own templates, creating personalized documents such as letters or internal memos. 

2. Word Templates for Any Contact: Word templates for any Contact are shared across multiple users within the organization. These templates are typically managed by administrators or individuals with appropriate permissions and are used to generate standardized documents, such as letters or contracts, related to contacts.

Here's how you can work with document templates in Dynamics 365. Scroll down to see the steps in detail with snapshots.
1. Create a Document Template 
2. Configure Template Parameters in MS Word Developer mode
3. Generate Documents from Templates 
4. Customize and Modify Templates

Advantages of Word templates in Dynamics 365 
1. Familiar and User-Friendly:
2. Seamless Integration
3. Consistent Branding and Formatting
4. Dynamic Data Population

Limitations of Word templates in Dynamics 365 
While Word templates in Dynamics 365 offer flexibility and convenience for generating documents, there are certain limitations to be aware of:
1. Limited Design Capabilities 
2. Compatibility Issues
3. Lack of Dynamic Content
4. Limited Data Filtering & Automation
5. Restricted Collaboration

Below is an example of the word template. We can fill in the details like Name, Address, email, Phone, etc with a single click of a button for any contact by mapping the fields in MS Word.

Steps to Create Word Templates in Dynamics 365

Step 1. Log in to Dynamics 365 and go to ‘Settings’ and click on ‘Advance setting’
Step 2. Click on ‘Templates’ under Business
Step  3. Click on ‘Document Templates
Step  4. Click on the ‘New' button to create a new email templates
Step 5. Select Word Template, and then select an entity to which the template applies. The template will use data from this entity. 
Click on the Select Entity button to download the template
Step 6. The Select Entity dialog box opens. The relationships you select on this screen determine what entities and fields are available later when you define the Word template. Only select the relationships you need to add Dynamics 365 data to the Word template. If there are no relationships then you can ignore it. When you're done choosing relationships, select Download Template.
Step 7. Save the file in your system
Step 8. Open the downloaded template in MS Word.
Now we need to map the Dynamics CRM fields into a Word template. To do this the "Developer" tab should be enabled in MS Word. If it's not enabled then you can follow the below steps to enable Developer mode-:

Steps to Enable the Developer tab in MS Word

Step 9. Open any Word template file. Or just create a blank Word document.
Go to File > Options > Customize Ribbon
Step 10.  Select the Developer check box. Select OK. The Developer tab now appears in the Word ribbon.
Step 11. In your Word template, select Developer > XML Mapping Pane.
Step 12. The XML Mapping pane opens with the default XML schema selected.
Step 13. Select the Dynamics 365 XML schema. It will begin with "urn:microsoft-crm/document-template/".
Step 14. Expand the entity to see all available fields, right-click the field you want to add, and then select Insert Content Control > Plain Text.
Step 15. The field from Dynamics 365 is added to the Word template.
Step 16. When the template has the fields and formatting you want, save it. We will upload it into Dynamics 365 now.
Go to CRM>Settings > Business > Template>Document Template>New(step 1- step5)
Select the entity and click on the upload button
Step 17. Click on Browse to upload the template
Step 18. Select the template which we created and click on open
Step 19. Click on the Upload button to upload the file
Step 20. As soon as you upload the template, the template details like status, name, type, etc will be visible on the screen. It will be in an activated state by default, you can deactivate or delete it from the command bar buttons
Note- If the template is not in the standardized format then it will show an error like below
Step 21. We have successfully uploaded the document, let's check the Word template now
Go to the CRM>Open any contact
Step 22. Click on the 3 dot option on the command bar and then click on word templates
Step 23. Your uploaded template should be visible under Word Templates (Dynamix Power Contact). Click on the file to download.
Step 24. The file will be exported to Word with all the contact details mapped into the Word document. Download the file, And open it.
Step 25. After opening the template, the mapped fields from the contact should be visible

The above template was a general word template that can be used by anyone in the organization. We have 2 kinds of word templates as below-

1. Personal Word Templates: Personal Word templates are specific to individual users and are used for personal or private purposes. Each user manages their own templates, creating personalized documents such as letters or internal memos. 

2. Word Templates for Any Contact: Word templates for any Contact are shared across multiple users within the organization. These templates are typically managed by administrators or individuals with appropriate permissions and are used to generate standardized documents, such as letters or contracts, related to contacts.

Step 26. So to create a personal word template, open any contact > click on the 3 dots option>word templates> upload template.

Now this template will be visible only to you and it will be shown only under the personal word template


The option to upload a Word template will only be visible to System Admins. 

If you wish to grant users access to create templates, you can follow the steps outlined below.

  1. Click Settings > Security > Security Roles. 
  2. Select a role, and then click the Business Management tab. 
  3. Select Document Template to set access for templates available to the entire organization. Select Personal Document Template for templates shared with individual users. 
  4. Click the circles to adjust the level of access.
  1. Adjust access using the security role.


Note- Word Templates can't be exported to any solution. Only the email templates, articles, and contract templates can be exported to a solution as shown below. 

We can transfer Word/document templates to other environments via XRMToolBox. I'll be covering this topic in the next blog.

No comments:

Post a Comment

Followers

Power Dynamix YouTube Videos