Overview
This article will help you create your first N52 Schedule within Dynamics 365. We are going to outline a simple sample in this document but you can also watch some of our training videos to see how to add different types of schedules.
Note the embedded Advanced Find shown in the above videos has been replaced by a simple Query Fetch XML field in CRM 2013 and later versions . So you will need to manually obtain the Fetch XML from the out of the box Advanced Find and then copy and paste into this field.
Create your first Schedule
The following steps walks you through creating a basic North52 Schedule. The business case here is that we need to send out a monthly newsletter to all of the Accounts in our CRM system that are located in Canada.
Step 1
Create an on-demand workflow named Send a Monthly Newsletter - Canada that is linked to the Account entity. We assume that you know how to create a workflow with a Send Email step so don't document that here!
Step 2
Ensure that you have some test data of Accounts within your Dynamics 365 system that have the Address1: Country/Region field set to Canada and those Accounts have a valid test email address.
Step 3
Navigate to the North52 App and select Business Process Activities > Schedules. Create a new Schedule setting the following fields:
- Name: Send Monthly Newsletter - Canada
- Frequency: Monthly (This means that the scheduler will execute this schedule on a monthly basis)
- Schedule Type: Workflow
- Workflow: Send a Monthly Newletter - Canada (This performs the action of sending the email)
- Start DateTime: Leave the default value for testing purposes so that the Schedule executes immediately. However, for a real world test set the desired start date, for example: 06/03/2018 02:00 - This means that the scheduler will start the schedule on the 6th of every month at 2am. Note: when creating a new Schedule the Next Run DateTime is always set to the same as the Start DateTime
Step 4
Create an Advanced Find query which looks for all account records where the Address1: Country/Region field set to Canada. Click the Results button to ensure that you there are records that match the search criteria.
Click the Download Fetch XML button to save the Fetch XML file to your PC. Open this file in Notepad and Copy all of the text to the clipboard.
Step 5
Go back to your North52 Schedule record and Paste the Fetch XML text into the Query field.
Save your Schedule record.
Step 6
Click the Start Schedule option under the N52 COMMANDS button on the ribbon to activate your Schedule. A dialog will pop-up for a few seconds after which if successful it will auto close.
Step 7
You can review the Schedule's progress by navigating to the Background Processes related records list for Schedue record you have open. It will show the N52 Schedule workflow in progress. This workflow will then wait until it has reached the Next Run DateTime. When it does reach this DateTime it will:
- Execute the Advanced Find query (Fetch XML)
- Loop through all the records it finds
- For each record it will start the workflow Send a Monthly Newletter - Canada
The Scheduler has now completed the primary action of the schedule.
Step 8
Finally you can open and review the Schedule to see that the Next Run DateTime has been set 1 month into the future. And the Last Run DateTime has been set to the current datetime. You can also go to the Background Processes list to see a workflow in a waiting state until next month.
Step 9
At any time during the month you may open the Schedule and click on N52 COMMANDS > Stop Schedule to stop the Schedule. This will cancel the waiting workflow.