Summary:

Users may be unaware that the Exchange integration has failed. This is dependent on the cause of the error - depending on the cause, the integration may stay on a status of "In Progress", and never progress.

An escalation rule can be used to detect if the Exchange integration is not running. The EcngIntegration entity is not enabled for escalation rules by default, so adding one isn't totally straightforward, but it is possible.

WARNING: This part of the product is not normally exposed for customisation, however, you may possibly be able to alter it through the back end. Please note that CRM Support cannot recommend or provide ongoing support for changes made to CRM objects in this manner. If you do proceed with this change, please ensure that you test thoroughly before attempting it in a live environment, and ensure that you have adequate backup and rollback procedures in place.

 

Customisation steps:

1. Run the following SQL to enable customisation of the EcngIntegration entity:

update Custom_Tables set Bord_Hidden = 'N' where Bord_Name = N'EcngIntegration'

2. Go  to Administration - System - Metadata and carry out a metadata refresh.

3. Go to Administration - Customisation and select EcngIntegration from the list of secondary entities. Add a new Integer column called exin_workflowid with a caption of "Workflow ID".

4. Run the following SQL agaisnt the CRM database in Management Studio:

update Custom_Tables set Bord_WorkflowIdField = 'exin_workflowid' where Bord_Caption = N'EcngIntegration'

declare @tableid int
declare @maxid int

select @tableid = Bord_TableId from Custom_Tables where Bord_Name = N'WorkflowRules'
select @maxid = Id_NextId from SQL_Identity WITH (UPDLOCK) where Id_TableId = @tableid

exec crm_next_id @tableid

insert into WorkflowRules
values (@maxid, 'Time', 'Exchange synch status', null, 'vExchangeSyncStatus',
      '1>0 OR exin_LastSyncTime < DateADD(mi, -(exin_SyncInterval+10), Current_TimeStamp) AND exin_syncenabled = N''ON''',
      null, null, null, GETDATE(), null, GETDATE(), GETDATE(), null, 'EcngIntegration', null, null, null,
      null, null, 60, null, 'Y', null, null, null, null, null)

The above will create a new escalation rule that will trigger if the Exchange integration is not disabled, and has not synched for more than 10 minutes after the next due synch time.

5. Do another metadata refresh. This will allow the view we're using for the escalation rule to link to the EcngIntegration table.

6. Go to Administration - Advanced Customisation - Escalation and select the new "Exchange synch status" escalation rule. You should now be able to add new workflow actions. As an example, you could add a new Send Email action that will send a status email. In my test example, I then set the escalation rule to run at an interval of every 60 minutes.

 

More info:

No execution flag has been added to this escalation rule – it will trigger every time that the escalation rule is run, and the exchange synch is not working. If you wanted this to only send a single email, it would be possible to add another column to the EcngIntegration entity, and use it as a flag to indicate whether a notification mail had been sent out. The neatest way of doing this would be to create a new Date/Time field, add an action to update it with the current date, and then add a condition to the SQL clause in the escalation so that the rule would not be triggered if that date was more recent than the last synch date.