Using word templates in D365 Human Resources

Hello all,

Hope you all doing good during lockdown.

Today I wanted to catchup with you on how we can generate some basic letters (or documents) using word templates in D365 Human Resources. This is also available in D365 Finance and Operations and hence the below walkthrough is applicable for D365FO too.

The biggest advantage of Dynamics 365 stack is its integration with Office 365. There is a feature that exists in D365 where you can define from which entities and fields, you need the data to be displayed in the document (as long as it’s simple). Sometimes HR needs to generate documents such as employment letters, shared parental leave letters or maternity letters etc as part of their processes. Using word templates functionality, this can be acheived and stop there … before you imagine it in a big way, this is strictly for basic templates and I will tell you why.

  1. We cannot write any joint logic between two entities and hence we cannot make the template to a dynamic document. For example, we cannot display the legal entity’s full name as we can get only short code from the employment entity (ex: we can display “USMF” but not “constoso Entertainment systems”). Another example, system date cannot be added. So for certain details, you cannot rely on data entities. Some needs to be static.
  2. Since you need to generate the document in the same way you would do export to excel, hence the template should contain the data with root entity only. Example: In worker form, if you want to generate the template based on a selected record, then the root entity should be either worker or employment entity. If the root entity is different, then you cannot see the template option under export to word.

Out-of-box word templates available in D365 HR

Unfortunately, there are not many out-of-box documents that are available – Job template info, performance goals, ADA requirements.

Path: System administration > Office integration > Document templates

Out-of-box word templates

Lets say, you want to generate the performance goal document, go to goals form under Employment development module. Open any goal record and click on Office button on top right hand side in order to generate the document.

Export to word menu under office icon

Document will be generated as per the out-of-box template and you will see something like this:

Sample out-of-box goal document

Now, I will walkthrough you on how to create a simple employment letter.

Design your own template

Go to System administration > Office integration > Excel workbook designer and click on Create blank document.

Create blank doc

Download the file and rename it to “Employment letter template”. Now start designing the template as per the format required.

Add fields wherever you want

Wherever the yellow fields exist, I will add the fields from the respective data entity. Lets start with the first field “Name” as shown below:

Select entity from the dropdown

Select the entity from the dropdown and click on next, you will be able to see list of available fields in the selected entity. Select the required field and click Add value. The field placed on left-hand side like a bookmark as shown below:

Select the field to add the value in a given position

You can change the font, size or colour as required. You can add the fields from the relative entities too, for example for joining date, I have added employment start date as shown below. For title (or designation), I picked up worker title. As I said earlier, we cannot write any logics or cannot join data entities, where I can use position title instead of worker title.

Likewise, you can try to add any relevant fields you want to display. Once you are done, save and close it.

Tips: If you receive any error with placeholder value that is not getting added, then close and reopen the document. Try to add again. It worked for me.

Load the template in D365 HR (Document templates)

Navigate to System administration > Links > Office integration > Document template. Create a new record and upload the document. You can change the template name to more apt name. You can also see the root entity that will be displayed based on the entities I had selected in the template.

Root data entity should be reflected correctly when you upload template

Click on Ok and the template will be saved. There are three filters that are important in this form:

Enable/disable filters
  1. List in Open in office menu (Showns in Office icon in the respective form/listpage)
  2. Apply current record (only for the selected record or all records)
  3. Apply company (only to the current legal entity or all)

Generate the document from the D365 form

Let’s go to the workers list page and open any employee record. Here am opening my record.

Download the template per record

Download the file and a document will be downloaded. Here is how it looks:

Downloaded sample template

Similarly, I have tried for leave approval letter, though I was partially successful as I was not able to get all leave dates applied for a particular request.

Another example of a downloaded document

If you guys already tried out anything on this and if there is a better way of handling this, please let me know.

Happy and safe lockdown!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑