Skip to main content

Using SCRIBE Online For Scheduled Tasks

While doing client work, I ran into a need where we needed to scan for records where a date value is 3 months in the future (i.e. 3 months from today) in Microsoft Dynamics 365.  There are a few options to accomplish this:
  1. Microsoft Dynamics 365 SDK (Developer Guide)
  2. Timed workflows
  3. SCRIBE Online
The issue with using the Microsoft Dynamics 365 SDK (Developer Guide) is you need a software developer to create a console application that is linked to a Windows scheduled task to run every night to connect to CRM, query the records and make the changes.  This means if you need any updates to the application you need to developer to change source code.  This is a viable option if you have an internal development team that can support the application.

When it comes to using timed workflows with wait statements, we would need to have the workflow fire at a specific time in the record.  In this scenario, this means that the workflow needs to fire to start the countdown (wait) when the record was created or when the date field we are monitoring changes.  The problem with this is the more waiting workflows you have in the system, you will start to see a degradation in performance.  Also, if someone manually changes the date field you will need to find the previously waiting workflow to stop it as you will have duplicate workflows waiting.  This can be a nightmare to manage.

The solution that we came up with for this client was to use SCRIBE Online to perform these actions.  Typically, when we think of SCRIBE Online, we think about connecting 2 systems, replicating data to another database or migrating data from one system to another.  There is more that we can do with it and this is one of the areas.  In this scenario, we have an integration map that is setup with only 1 connection as both the target and the source (Microsoft Dynamics 365).  We set the solution containing the mapping to run nightly and query for any records where the date field on the record is 3 months from the date the mapping is running.  If it is true, then it generates a record that will kick off a record creation in CRM (Triggering Entity) that will kick off a workflow to generate a bunch of related records to the account this the date field.

With the above setup, there is no need for a developer to update code as the process can be updated with the internal CRM workflow and SCRIBE Online, which both use an easy to understand GUI.  By moving the counter outside of CRM, we also make sure that the CRM system won't lose performance.

The main reason for my blog post about this, is to show that we can use SCRIBE Online for more than just data migration, integration and replication.  The more that I work within SCRIBE Online, the more I can see its use for other tasks.


  1. Depending on the legacy database and the connection source, what do you think about creating another table with just the date ranges you need and put a Where clause in your original query using SSIS? If you need to update the range then edit the table.


Post a Comment

Popular posts from this blog

XrmToolBox Bulk Attachment Manager - Version 2018.2.2.7 Released!

Today I have published version 2018.2.2.7 of my XrmToolBox plugin.  The purpose of this plugin is to make it easy to download and backup attachments in CRM.  This release is a major release as it is the first built version with all pieces working.  The first version only had note downloads working.

Overview of Plugin:
Current Version: 2018.2.2.7Purpose: Download Attachments and E-Mail attachmentsGitHub Link.GitHub Wiki Link.Nuget Package Link.How To Use The Tool: Launch XRMToolBox.Connect to organization.Step 1, choose what you want to download. (Once a choice is made, Step 2 becomes usable)Notes - Download attachments from note entity.E-Mail - Download attachments from emails.Both - Downloads attachments from notes and emails entities.Step 2, choose if you want to download all attachments in the system or specific attachments.  All Attachments - This will search the chosen entity to find all records that have an attachment and download them.Click on "Browse" and choose where t…

Dynamics Set IFrame URL - D365 v8 vs. D365 v9

While doing client work, I came across a problem with setting an IFrame URL dynamically.  The underlying issue was that the sandbox instance is on v8 of Dynamics 365 and production is on v9 of Dynamics 365.  The reason for this was because this client was setup around the time that Microsoft rolled out v9.  Anyways, JavaScript that I wrote to dynamically set the URL of the IFrame wasn't working in the v9 instance.  This was because of changes that Microsoft made to how IFrames are loaded on the form and also changes to JavaScript.

Here is my v8 setup:
JavaScript runs OnLoad of contact form.  This works because of how IFrames are loaded in v8.  You can also run it on either a tab change (hide / show) or OnReadyStateComplete event of the IFrame.  Depending on your setup you will need to choose which is best for you.  For me in this case it was the OnLoad event.Here is the JavaScript: function OnLoad() { //Get memberid var value =…

Updated To Version 1.7 - Azure Blob Storage For Storing Microsoft Dynamics 365 Attachments

In another post I talked about using Azure Blob Storage to store CRM attachments in Azure rather then in CRM.  Today I installed the app in a clients CRM system and found that Microsoft Labs updated the App to version 1.7.  This change had a lot of updates from UI to how to setup notes attachment movement.  Also they now allow for moving of existing attachments.  Here is the updated steps:

1) Go To AppSource
2) Install the Attachment Management App by clicking the "Get It Now" button under the image.
3) While its installing go to Azure and setup your blob storage account.
4) For each CRM instance you will need to setup 2 containers in your blob storage.  One is for email attachments and the other is for notes attachments.  So if you have a production instance and sandbox instance you will need to have 4 containers (DevEmails, DevNotes, ProdEmails, ProdNotes).  If you want to separate note attachments by entity, then create one container per entity.  The DevNotes or ProdNote…