There is quite a lot of literature regarding creating Word Templates around now, I touched upon it in my previous post, and the infographic here on twitter. When was I was recently researching a separate blog post, I came across a way to create a Word Template using an out of the box Action and a simple Workflow. From playing around with this, I’ve thought about loads of ideas and solutions that could utilise this functionality and how it can be extended to create things like auto-generated scheduled emails (which are unavailable in CRM Online as they are on Premise), things like Goal leader-board updates and things like that. I’ll be working on some of these in the future and they will feature in some posts coming soon.
Auto generating templates sounds like nice functionality, but it still needs to have a purpose. The reason I’m saying this is because you could be generating this automatically to save the user clicks, and so they can email straight out to a client, it could be part of a grander process and is something where the action is triggered by somebody and the document is picked up by another etc. However there are other ways to meet these kind of requirements that could be explored including automatic emails using pre-defined templates and also other concerns such as if saving templated documents could potentially cause a size concern depending on how often the process is completed.
The walkthrough in this post will go through how to auto-generate the OOB Campaign Summary template on completion of the Campaign(change of status reason) so it can be quickly accessed via the notes (which can be exposed using a view if you wanted). This is template is for internal use and review and not for external use in this scenario.
1. Navigate to your Solution
2. Go to Processes
3. Create a new Process on the Campaign entity of type ‘Workflow’
4. Configure the settings so that it is set to execute on ‘When Record fields change’ and the field is ‘Status Reason’.
5. Change the scope to run for the Organisation
6. Create the first clause of the Workflow to check the status is ‘Completed’
7. Now create the next (nested) action to be a ‘Perform Action’ step (see below)
8. Select the Action ‘SetWordTemplate’ and then set the Entity to be (None (global))
9. Select ‘Set Properties’
10. Select ‘Selected Template’ to be the Microsoft Word template you require – if the template is the type of entity you are executing this on, it will be pre-filled when generated, if it isn’t, it won’t be and will only have placeholders, being a true ‘template’.
11. (below) Set the Target (the entity record you want the template to be attached to) to be your Campaign. This should be automatically selected when you click in this field and you can just select ‘OK’ on the right hand side to place the mapping in the field like the picture below. (You could, for example, set this to be a global static specific entity here, if your requirement dictates it).
12. Your workflow is now complete, save and activate the workflow
13. Below is the example of the workflow in action. I extended some sample data on a Campaign, set it to ‘Completed’, and there is my auto-generated document attached to the notes. The screenshot below shows the end result of the document when you click on the Attachment.
That’s it! It’s really simple and you could actually create some really complex and interesting scenarios with this functionality. I’ll be building up some more complex ones and will feature them in some XRM Solutions which are currently in development and will be published soon!
Any questions, please leave them in the comments and I’ll do my best to help!