This blog article outlines how to execute an additional “Attach document”-operation by checking the Run workflow checkbox in the DocumentsCorePack Dialog (highlighted in yellow below). Therefore you have to create a workflow, which will then be displayed in the Run workflow drop-down menu.
More information about how to create a workflow can be found here.
Please open your Microsoft Dynamics 365 and navigate to Settings > Processes. In the My Processes – area, click on the [New]-button in order to create a new workflow. A dialog pops up. Type in ❶ the name of your workflow, determine ❷ an entity – MSCRM-ADDONS.com AutoMergeWorkingItems in this case and select ❸ Workflow as the process category. Afterward, hit the [OK]-button.
The window below pops up, where you can configure your workflow in detail. Please check the ❶ As an on-demand checkbox in the Available to Run-area and as Scope select ❷ Organization. Next, please add a new step by hitting on the [Add Step]-drop-down menu and select ❸ Create Record.
As soon as the step has been added to your workflow, please enter ❶ a name that remains you of what it contains, e.g. Attach note. Then open the drop-down menu, select ❷ MSCRM-ADDONS.com AutoMergeWorkingItems and hit the ❸ [Set Properties]-button.
The dialog below opens. It allows you to configure your workflow. Again, give it a ❶ name – Attach a note in this case and select ❷ AttachToEntity in the AutoMergeAction-field. Next, set the cursor in the ❸ PrimaryRecordUrl-field and select ❹ PrimaryRecordUrl in the drop-down menu in the Form Assistant, click on the [Add]-button and hit the [OK]-button below (highlighted in yellow). The PrimaryRecordUrl-field is filled now. Do the same for the ❺ EntityToAttach (RecordURL(Dynamic)). Then, set the cursor in the ❻ DocumentGUID-field, select CreatedDocument in the Form Assistant and proceed like before. To finish the workflow, please do not forget to click on the ❼ [Save and Close]-button.
After finishing the configuration, do not forget to activate your so created workflow by hitting the [Activate]-button located at the top.
To see the result, please open the DocumentsCorePack Dialog by hitting the [Create Document]-button in your Dynamics 365. As shown in the first figure, the dialog ❶ attaches the document as an email attachment and by checking the ❷ Run workflow checkbox you can start the so created workflow and also attach it as a note.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to firstname.lastname@example.org.