• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/How to create scheduled reports

How to create scheduled reports

935 views 0 Updated on August 21, 2024

NOTE: This article describes the creation of a classic scheduled workflow.  For a similar example that demonstrates the creation of a scheduled payment reminder using Microsoft Flow, please see here.

With the option to schedule document operations inside Microsoft Dynamics CRM, DocumentsCorePack opens up its capabilities for scheduled reports.

Whether you wish to…

  • …get a simple overview of all opportunities closed last month,
  • …send a reminder to a group of selected customers automatically, or
  • …find a printed copy of all invoices every morning in your printer,

with scheduled reports this is not only possible, it is also easy.

This article describes which preconditions are needed in order to run the tool and provides a step-by-step instruction of how to use the scheduler.

How does the scheduler work?

The Scheduler allows you to define queries for CRM records where a certain workflow is executed by following a defined schedule.

You will need the following components to operate the scheduler:

  • DocumentsCorePack workflow integration, which allows for automatic document generation and processing inside MS CRM workflows, and
  • The Mscrm-addons.com Scheduler entity, which allows for workflows to be scheduled

Step-by-Step: Defining a scheduled report

Step 1: Creating the workflow

In our example, we would like to create a workflow that would remind all customers with outstanding bills automatically via email.

To begin, we will need to create a new process by navigating to Settings > Processes and clicking on the New button.

NOTE: If you have not created a workflow in Microsoft Dynamics CRM yet, please see the following articles here:

  • in CRM Online here
  • in CRM on premise in our documentation
Creating a new process
Figure 1: Creating a new process

The Create Process window opens. Enter a suitable ❶ process name for your process and set the ❷ category to “Workflow” and the ❸ entity to Invoice. Click OK once you are finished to proceed.

Setting our name, category and entity for our process
Figure 2: Setting our name, category and entity for our process

A new window will appear. This is where we will configure the steps for our workflow.

The process information window
Figure 3: The process information window

Step 2: Adding steps to our workflow

Next, we’ll need to add steps to our workflow. In our example, we want to create a document, attach it to an email, and send it. To do that, we will need to create five steps in the following order:

  • Create a document
  • Wait for document generation
  • Create an email
  • Attach document to email
  • Send email

Create a document

To create our first step, click on the Add Step dropdown and select Create a Record.

Adding a "Create Record" step
Figure 4: Adding a “Create Record” step

Then, set the record to be created to MSCRM-ADDONS.com AutoMergeWorkingItems. Click on Set Properties once it’s been set.

Setting the record type, or entity
Figure 5: Setting the record type, or entity

You will be prompted to configure the MSCRM-ADDONS.com AutoMergeWorkingItems record, which is the record type responsible for generating documents. Enter a ❶ name for your record and set the ❷ AutoMergeAction to CreateDocument. Underneath, select the ❸ template that should be executed.

Setting name, action and templat
Figure 6a: Setting name, action and template

On the right side of the window, the ❹ PrimaryRecordUrl should be set to the dynamic record URL from the Invoice entity. This can be located in the second dropdown as shown below. The ❺ SaveAs field should be set to PDF. Save and close the window once you’re done. This will add the step to the workflow.

Setting the PrimaryRecordUrl and file type
Figure 6b: Setting the PrimaryRecordUrl and file type

Wait for document generation

The next step will be a wait condition. Adding this step will cause the workflow to wait until the document generation has finished. This will be important, as later, we will need the GUID of the created document, which will only be available once the document has been generated.

Figure 7: Adding a wait condition

The wait condition will also need to be configured. Open the configuration window and click on the dropdown. Select the previous step (under “Local Values”), then set each subsequent dropdown to Status, Equals, and Inactive respectively. This will ensure that the workflow will wait until the status of the record is inactive.

Save and close this window after the settings have been entered.

Setting the wait condition
Figure 8: Setting the wait condition

Create an email

Add another Create a record step underneath the wait condition. This time, set the record type to Email.

Creating an email
Figure 9: Adding a step for our email

Fill out the email information, including the From, To, Subject, and email body.

Filling out our email
Figure 10: Filling out our email

Attach document to email

After saving, add another Create Record step, selecting the MSCRM-ADDONS.com AutoMergeWorkingItems record again. In the properties window, enter a name and set the AutoMergeAction to AttachToEmail.

Setting the action to "AttachToEmail"
Figure 11: Setting the action to “AttachToEmail”

With this action set, navigate to the Attach To Email section of the record. Set the EmailToAttach field to the email message created in the previous step. It can be added by selecting the email step in the upper dropdown, then “Email Message” field in the lower dropdown.

Adding the email the record should be attached to
Figure 12a: Adding the email the record should be attached to

Similarly, in the DocumentGUID field, add the GUID of the created document by selecting the step where it was generated in the upper dropdown, then the “CreatedDocument” field in the lower one. Save and close this window once finished.

Adding the document's GUID
Figure 12b: Adding the document’s GUID

Send email

For our last workflow step, create one last Create Record step, setting the record once more to MSCRM-ADDONS.com AutoMergeWorkingItems. When opening the properties window, name the record and set the AutoMergeAction to SendEmail.

Setting the AutoMergeAction to "SendEmail"
Figure 13: Setting the AutoMergeAction to “SendEmail”

In the EmailToSend field under Send Email, add the EmailToAttach field, which can be retrieved from our previous step. Save and close the window once you are done.

Adding the email to be sent to our record
Figure 14: Adding the email to be sent to our record

Our finished workflow looks like the following:

Our finished workflow
Figure 15: Our finished workflow

Save the workflow and activate it. This will prepare our flow to be used by our scheduler.

Step 3: Creating a scheduler

With our workflow finished, the last thing we must do is create our scheduler. This can be done by creating a new MSCRM-ADDONS.COM Scheduler record (an entity that comes with the installation of DocumentsCorePack).

Note: You can use Advanced Find to create a new MSCRM-ADDONS.COM Scheduler record when searching for the entity.

To enable the scheduler, you’ll need to configure the following fields:

  1. Name: Enter a name for the scheduler
  2. Status Reason: Set the status reason to either active or scheduled. In this case, it should be set to scheduled. Setting it to active will trigger the scheduler manually upon save.
  3. Execution Amount: Set how often the scheduler should be triggered.
  4. Next Execution Date: The next date in which the scheduler will be triggered. This can be manually adjusted.
  5. Workflow: The workflow that should be run. In our case, the scheduler will run the workflow we just created.
  6. Fetch: The FetchXML to be applied over the scheduler. It is used to filter which records the scheduler should run for.
The scheduler record
Figure 16: The scheduler record

Since we only want the scheduler to run for outstanding bills, we will need a fetch that will retrieve only those invoices.

Creating a fetch

We can create a fetch by utilizing Advanced Find. If, for example, we ❶ search for invoices with a due date from the last seven days, we can then ❷ download the fetch used to get those results.

Downloading a fetch
Figure 17: Downloading a fetch

The downloaded fetch
Figure 18: The downloaded fetch

With the fetch created, we can then copy and paste the fetch into the Fetch field within the scheduler. Once saved, the scheduler will be activated.

The completed scheduler record
Figure 19: The completed scheduler record

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.

Was this helpful?

Yes  No
Related Articles
  • 3 Ways DocumentsCorePack Transforms Proposal, Quote, and Contract Creation
  • DeepSign for DocumentsCorePack 
  • Generate and send a document for e-signing using DeepSign
  • How to prepare a document for DeepSign
  • Why Document Generation Is Still the Most Broken Part of Your CRM Workflow
  • How to migrate One-Click-Actions (OCAs) between environments
Latest Articles
  • How to Eliminate Excess Storage Costs in Microsoft Dynamics 365 Without Losing Access to Emails and Attachments
  • 3 Ways DocumentsCorePack Transforms Proposal, Quote, and Contract Creation
  • DeepSign for DocumentsCorePack 
  • Generate and send a document for e-signing using DeepSign
  • How to prepare a document for DeepSign
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How licenses are counted
  • How to insert Condition Fields in DocumentsCorePack Templates designer
Categories
  • *News and General Infos* 64
  • Webinars 45
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 257
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 74
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.