One-Click Actions (OCAs) are predefined settings for the DocumentsCorePack-Dialog to simplify and streamline document generation and delivery within Dynamics 365 and PowerApps.
Admins create OCAs, that are offered to authorized users in the DocumentsCorePack-Dialog, when they click on the [create-document]-button after selecting a record/records in an entity view.
Example: Accounting needs to generate PDF invoices, send them by email to the customer, save a copy to SharePoint and also get a printed copy.
An admin can automate these tasks by putting them in an OCA that acts as a mini-app that users can then run with a single click.
Documentation: One-Click-Actions User Guide.
Step-by-Step Video: How to configure a One-Click-Action
In this guide, we will show you how to create a new one-click-action to send pdf by e-mail to a customer and save it to SharePoint.
To get started, open your Dynamics 365 Settings, navigate to the “MSCRM-ADDONS”-section, and select DocumentsCorePack.
The main configuration window provides you with a few tabs that allow configuring DCP in general.
❶ This is the “One-Click-Actions”-tab in the DCP main configuration window. Click to get into this area.
❷ It shows all available entities.
❸ The search function helps you to find the entity for which you want to create One-Click-Actions.
In this case, we search for the entity “Account” and hit the [Edit]-button on the right side, which opens the “Account” One-Click-Actions.
In this window hit the [New Single]-button to create a new Single Action OCA.
A new dialog opens up, where you have to enter the name of your One-Click-Action, “Test OCA” in this example. Press the [OK]-button.
After hitting the [OK]-button, you will be provided with the configuration window for “Single Record Actions“. You will be assisted by a 4-step wizard. Please go through the following four screens to configure your One-Click-Action in detail:
Please note that the available wizard options may vary depending on what was previously selected!
Step 1: General Settings
❶ You have named your One-Click-Action earlier and now you have the possibility to edit the name you have entered.
❷ You can add a description (Helpful for users running the OCA).
❸ It is also possible to set this action as default by checking the corresponding box, which means always running this OCA when clicking the [create-document]-button.
❹ These buttons allow you to move forward to the next step or back to the previous one. When you are happy with your configuration, then switch forward.
❺[Save]-button (Saving changes on your OCA so far).
❻ You can delete your just created One-Click-Action.
❼ The plus-icon button is used to open a dialog for defining display rules. Display rules act like filters to hide the OCA when they match. There are three categories of display rules. They can be user-centric based on D 365 security roles, or they could be based on entity attributes (field values that must match those of the selected record/records). Attribute based display rules can be created more ambitiously using XML to define more sophisticated rule sets (Fetch). If nothing is set, everyone can see the OCA.
Step 2: Template Settings
These settings help you to configure your template selection in detail. In our example.
❶ There is a selection drop-down menu with three types of templates as options.
❷ Activating the Edit Template checkbox enables the user to edit the template before the document would be created.
Let´s start with
a) “Allow User Selection”
Choosing “Allow User Selection“, defines an OCA where the user can select a template themselfs, when running the OCA.
As can be seen in Figure 7, This template type offers a grouping feature. ❸ Clicking the [Conditional Template Group]-button opens a window where you can set specific template groups based on the current record attributes to be shown to the user (E.g. useful if you want to offer only templates from the same department as options).
To check how this looks from a user’s perspective, you can select your “Account Entity” in your Dynamics 365 and press the [Create Document]-button.
The DocumentsCorePack Dialog opens so you can select your template. Press the [Next]-button.
Figure 9: Step 2 – Allow user selection – DCP-Dialog Templates
b) „Predefine Template“
The 2nd template type in the drop-down menu in step 2 of the wizard is “Predefine Template”.
Clicking in the “Template” field ❶ (Figure 10 and 12) opens a look up window to search for a suitable template that you want to set for the OCA.
Please Note: This means that the user does not have a DocumentsCorePack template selection, the template is used automatically.
By the way, check out this article if you are interested in learning about template creation!
A [Conditional Template Selection]-button is provided for this template type.
You can open a window to define templates that are conditionally displayed to the user based on attributes that must match attributes of the current (user-selected) record.
For example, based on a customer’s location, the template of the appropriate language can be automatically supplied when the user runs the OCR.
Now look for a template for your entity “Account” and add it.
Please Note: Click on the [Add]-button to add a template or note, otherwise the template will open.
In this case, it is the “Account_Overview.docx”.
❶ You can see your chosen document.
❷ Switch to the next step.
c) “Use MultiPart”:
❶ The next in the drop-down menu is “Use MultiPart”.
A compound document (made up of parts such as dynamic DCP templates and static documents such as pdf files etc.) as a mixture of several predefined and/or freely selectable documents is possible.
In the following, we will call the document parts DocParts for short.
❷ This is the section of the selected documents you want to concatenate.
a. With [+]-button you can add another template,
b. Delete it, or
c. Combine the selected DocParts. To do this, you have to select more than one document to combine it.
❸ Define the options for concatenation of this document. Learn more about the Concatenate Syntax.
❹ Based on conditions from your entity you can define display rules to show or hide a DocPart.
❺ Define if this DocPart is optional or not on the DCP-Dialog
❻ Define if this DocPart is visible or not on the DCP-Dialog.
❼ Switch to next step.
If you press the [Concatenate]-button ❸, a wonderful overview opens where you can define your concatenating options over the drop-down-list and confirm it.
Step 3: Processing Settings
At this step, you can define the actions which should be done after document creation. In this example, the action is defind as
❶ send the Account_Overview as .pdf
❷ Attached as MS Note document.
❸ Save it to SharePoint
❹ You can set your General Behavior. There are 3 possibilities:
- Set configured settings as default
- Hide configured settings
- Disable configure settings
❺ Here you can inherit the main behavior or
- Do not save
- Set as default
- Hide this setting
- Show, but do not allow changes
❻ Switch to next step
Figure 15: Step 3 – Configure your OCA
Step 4: Review Settings
You have the possibility to review your document, create a “PNG preview” and automatically open your document like you can see in the figure below.
After configuring all steps, you have to save your actual One-Click-Action (highlighted in yellow).
Test your OCA
If a Dynamics 365 user now clicks on the [Create Document]-button , the user will be automatically provided with the new one-click-action (here: Test OCA).
Figure 18: Creating a document with OCA
Click on your Created One-Click-Action document and depending on your selection (2a, 2b, 2c) this window will open. Check the options you have and press the [Next]-button.
Figure 19: Create a document
Your created documents are shown. Click next.
Figure 20: Created documents
Here is a preview of your generated document. You can edit or you can finish the One-Click-Action.
Look back in Dynamics 365 for your generated template:
Figure 22: Generated Template
That’s it! We appreciate your feedback! Please share your thoughts by sending an e-Mail to firstname.lastname@example.org.