This article outlines how to add documents stored on SharePoint to an email via the DocumentsCorePack (DCP) dialog. The article will cover how to enable this feature and will walk you through an example use case.
Our Use-Case: We would like to send an email from a quote record. This email should have a generated document based on the quote itself. In addition, users should be able to select additional documents from SharePoint (Product specifications) to be attached to the email.
Prerequisites
To enable this feature, the following prerequisites must be met:
- AutoMergeGlobalButton: 2020.220 or higher
- AutomergeServerCore: 2020.139 or higher
- To update either of the above, see here
- A SettingsKey with the following values:
- Name: AdditionalDocuments
- Product: DocumentsCorePack
The SettingsKey’s value should be formatted like the following:
{"flagActive":"ENTITY","fields":{"ENTITY":["LOOKUP"]}}
- Note:
- ENTITY: Entity that should have this feature enabled.
- LOOKUP: Lookup to related records whose document locations should also be made available.
- Please refer to Figure 1 below for an example
Step-by-Step description
Since we want to start this process from a quote record, we’ll need to make sure our SettingsKey is configured properly.
You can copy and paste the following value into your own SettingsKey:
{"flagActive":"quote","fields":{"quote":["customerid"]}}
This configuration will enable access to files located in the SharePoint location of the quote record as well as the potential-customer record. Once configured, navigate to a quote record of your choosing. Open the Create Document dialog and continue until you reach the document processing options.
Here, you can select to attach a document (1) as email attachment or as email content. Selecting either option will cause the (2) Additional Attachments setting to appear. When this setting is checked, the button to select files will be enabled.
In our case, we want to add our additional documents as PDFs, so we will attach our documents as email attachments. We will then click on the Select Files button after enabling it.
A new window, titled Document – Selection, appears. In this window, you can navigate through your SharePoint folders and select which files you would like to add to your email. You can add any file by double-clicking it and selecting OK. In our case, we will add our product PDFs.
Once your files have been added, you can proceed with the document generation process. When the process is finished, your email should have the generated document and the additional documents added.
Additional Examples
In situations where other document locations are not needed, we can adjust the SettingsKey value to exclude the lookup from the document selection window. The value can be formatted to the following, where ENTITY is the entity’s name to configure the setting for:
{"flagActive":"ENTITY"}
Alternatively, if the setting should simply be enabled for all entities, the following value can be used instead:
{"flagActive":true}
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.