Tuesday 7 June 2016

Document Templates in CRM 2016

Whenever there is an update in CRM, we all know that there will be some exciting features in it.
Dynamics 2016 has brought a new way to represent the data by allowing user to create there own templates. This is almost similar to mail merge but very easy to work and use. Templates can be used for Word and Excel.
Word Templates
Here are steps that shows how to create and update a word template on Opportunity Entity.
Open any opportunity and click on Work Templates as shown in Screen shot.
We can create templates from Templates section too.

Navigate to Settings --> Templates --> Click on New --> Select Word Template and Entity and then click on Select Entity button.

This will open a popup to select the related entity relationships.
Select the relation ship and click on Download Template.

Save and Open the template
The template will be empty. To map CRM attributes, we need to enable Developer settings.
Go to File --> Options --> Customize Ribbon and Select Developer --> Click OK
After that select Developer from the Ribbon and click on XML Mapping Pane
Change the Custom XML Part to the link which starts with "urn"
It will display the Entity attributes and relation ship which we have selected while downloading the document template.

Select the fields and right click and select 'Insert Content Control' and create your layout using word tools.

The Associated entity fields are at the button of the list.
Insert a Table on the document with Two Rows (One is Header and other for data mapping)
Select each cell and map the required fields.
The most important part, Select the entire row (all the cells of the row, make sure you don't select  the table or the row from the table border).

Once the entire row is selected, right click the relation ship and select Repeating from Insert Content Control menu.
The table should look like the below screen shot.
Save the document.

Open CRM, navigate to Settings --> Templates --> Document Templates --> Click on Upload Template button. 

Browse the file from your location machine and click on Upload. CRM creates a document template record as below.
Open the record in CRM and Select the Template which you have uploaded as shown in the screen shot.
Here is the document generated for us.
--
Happy CRM'ing
Gopinath

1 comment: