Restarting Record Creation and Update Rules in Dynamics 365

Roshan Mehta, 08 May 2017

We’ve recently worked on a large Case management system for a client, which uses Record Creation and Update Rules in Dynamics 365. The basic configuration of the client Dynamics CRM system is as follows:

1.    Multiple Queues and corresponding mailboxes with email addresses
2.    Email Router configured to monitor Queue mailboxes in Exchange
3.    Record Creation and Update Rules to create Cases when Email Messages are delivered to CRM and routed to Queues

Through our testing, we realized that the Record Creation and Update Rules steps would often fail in several scenarios. The System Jobs would show the failed steps with a status of Error: Needs Attention.

image

Unfortunately, it’s not possible to resume the failed steps by restarting the System Jobs. Instead, we needed to build a light-weight Windows Service that would retry the Record Creation and Update Rule steps on Queue Items.

The Windows Service simply queries Queue Item records for incoming email messages. For each Queue Item retrieved, we execute the ApplyRecordCreationAndUpdateRulesRequest which retries the Record Creation and Update Rule.

The great thing about this request is that it will not retry a Record Creation and Update Rule step on a Queue Item that had already been processed successfully. In our scenario, it would prevent duplicate Cases from being created in Dynamics 365.