Search code examples
dynamics-crmdynamics-crm-2011crmdynamics-crm-4

Sending an email from a CRM workflow not working


I've built a workflow that sends an email when a field in the Contact entity is changed. When I specify a User in the To field of the email form, everything works as expected.

However, when I specify a User field that is located on another entity, the workflow completes but the email isn't sent.

This User field is located on a configuration entity that I've linked to the Contact entity - I'm able to use the Form Assistant in the workflow's Email form to pull the field up. It looks like this:

{ConfigurationEmail(ContactToConfig (ConfigurationEntity))}

ContactToConfig is the relationship between Contact and ConfigurationEntity. ConfigurationEntity contains a User lookup field that is currently populated with a User.

To test this, I've CCd a working User and I've placed the above reference in the body. The email is sent to the CCd user but not the other one (using the above reference). Nothing comes up in the body of the email, which tells me the reference isn't resolving.

Any idea why this isn't working?

UPDATE: I think I need to somehow specify the instance of the ConfigurationEnity. There's currently only one, but I think the above reference is looking at the Entity, and not the specific object with the data.


Solution

  • On your Contact record you would need to populate the lookup (might need to add it to the form first) with your one configuration entity. When the workflow is looking up which record to use, it is only looking for the one record that relates to the one Contact the workflow happens to processing at them moment. Right now I'm guessing the value is empty so the email would have no recipient.

    With this approach, this would mean you need to set your configuration entity on every Contact record for this to work for any given record. You could use another workflow to run when the Contact record is created to set this value (or perform some if/else logic if you add more configuration records). You could also do a bulk edit to set the existing values.