In this post I will show the Workflow steps to achieve same functionality by automating & scheduling this process, with CRM Workflow.
In our example, we create the workflow for the Invoice entity, to PDF the “DO_Invoice-Elaborated” Word Template, and upload it to a set location in SharePoint. The workflow has 3 steps. The first step creates the document from Word Template (SetWordTemplate), then we PDF the document, and as last step, we save the document in SharePoint, as per this image
In SetWordTemplate input properties use Dynamic Values to select the Template and target. The target is the record of the Invoice entity, as we create document for a record.
In the input Properties form, for workflow step Add Word template, we have 2 sections. The top 2 input fields are shared with workflow to upload to SharePoint and to attach the PDF file to an Email. The other 5 input fields are only required when delivering the PDF file as an attachment to an Email, and should be ignored in this workflow.
Using Dynamic Values, we firstly select the Word template. In the second input field we assign the file with a dynamic name, which is the Invoice Number (Invoice ID)
The properties of the last step to upload PDF-Doc document to SP, The Record ID is a dynamic value created by firstly selecting Convert to PDF from the Local Values (at the bottom of the list) and then selecting Record ID. The SharePoint location is a text input in the format of Parent Folder/Child Folder/Grand Child Folder.