Workflows – Introduction. Workflows are one of the most useful and underrated features of Microsoft Dynamics CRM 2011 development. Xaml workflow allows you to write workflows without having to use any C# code (well, it’d be more correct so say ‘generally allows you to’, there are some exceptions – but in those cases, you can create your own Activity classes, reference them and use.
Recently, our Dynamics CRM team encountered a client problem associated with emails sending out through Microsoft Dynamics CRM 2013. The client had set up a series of custom workflows that were designed to create email messages that would inform our client’s users and CRM records about important changes. The emails were supposed to be generated through these custom workflows, but our clients noticed that the status of the email activities was set to “Pending Send.” On further inspection, the message at the top of the form was “This message has not yet been submitted for delivery. For more information, see help.” What’s worse, our client discovered that these messages were never delivered.
The Solution When a workflow creates an email message, Dynamics CRM inserts a Null value into the delivery attempts attribute of the email activity record. This happens if you don’t specify a value in the “ No. Of Delivery Attempts” field.
The email router will always looks for this attribute, and it will check whether the delivery attempts value is 0 or greater. If the value is Null, the email router will ignore it. That is the reason why scheduled email activities weren’t being sent out.
Fortunately, there’s an easy fix for this problem: 1) Update the field “ of Delivery Attempts” in the workflow step and set it to 1. Now, this will only resolve the issue for the emails that are going to be created in the future, but there may still be Pending Send emails that haven’t gone out. 2) To address the stuck Pending Send emails, create an on-demand workflow that sets the status to draft first. Then add another step to update the email record with the “ of Delivery Attempts” (again, update this to 1). Once that field is updated, add a step to update the status to Pending Send.