Answered by:
CRM 2011 workflow to send email to dynamic value gets error "the email must have at least one recipient before it can be sent"

Question
-
I have created and am testing a new step in a CRM2011 workflow to send an email to the requesting user on a Client Setup/Change form. I am the requesting user in my testing. When I use a dynamic value {Requested By(Client Setup/Change Form)} the workflow gets stuck in a waiting state with the message "the email must have at least one recipient before it can be sent". Yet if I specify my user (non-dynamic) as the recipient it works fine. This appears to show it's not an issue with my user's email setup. Any ideas why it can't recognize the dynamic value as a valid recipient? By the way, it does recognize the same dynamic value as a valid sender.Thursday, September 25, 2014 12:10 AM
Answers
-
Thanks to Microsoft Support tech Durgesh Jaiswal who worked with me online and discovered the problem. Someone in the past had created a second field with the same display name "Requested By" on the custom form used to trigger the workflow. This field had a type (Lookup) that didn't work as an email recipient. I did see both fields listed when I created the workflow and chose the email recipient, but thought they were referring to the same field since they had the same name. I assumed (incorrectly) there couldn't be two fields with the same name! It figures I had a 50/50 chance and happened to chose the wrong one. I assigned the recipient to the right one and now my workflow sends the email. To avoid this type of problem in the future, I went to the form and changed the second instance of the "Requested By" field (which wasn't being used anywhere on the form) to be "Requested By_new". MORAL OF THE STORY - make sure your custom field's Display Name is unique on that form!
Orygunner
Tuesday, October 21, 2014 11:54 PM
All replies
-
Hi Ory,
Please refer the links below:
http://social.microsoft.com/Forums/en-US/f6eb6910-d7fc-41e2-815d-d8f99d78f063/crm-2011-onpremise-workflow-service-calendar?forum=crmdevelopment
http://www.williamgryan.mobi/?p=189
Saad
Thursday, September 25, 2014 3:57 AM -
Hi,
"TO” and ”FROM” fields in email can be filled only with Lead, Contact, Account or User .
So you cannot populate “TO” of “FROM” fields by attribute from custom entity by workflow.
But this can be achieved using the custom workflow.
pass entityreference as a input parameter
Entity Reference
[Input("EntityReference input")]
[ReferenceTarget("customentity")]
[Default("3B036E3E-94F9-DE11-B508-00155DBA2902", "customentity")]
public InOutArgument<EntityReference> CustomEntityReference { get; set; }And send email by taking the input parameter.
Thanks,
Sreeni Pavalla
- Proposed as answer by Sreenivasulu Pavalla CRM Thursday, September 25, 2014 4:38 AM
Thursday, September 25, 2014 4:38 AM -
Thanks Saad, but those links refer to a form that has been deleted and this does not apply to the form I am using. My workflow triggers off of a simple field value change on the form, so the form is still out there when the workflow is processing.
Orygunner
- Edited by Orygunner Thursday, September 25, 2014 6:23 PM
Thursday, September 25, 2014 3:44 PM -
Thanks Sreeni but I am a CRM newbie and am not sure how to implement your proposed solution. But I can say the dynamic value I am using in the email - {Requested By(Client Setup/Change Form)} - does in fact work as the "FROM" value so I don't understand why it won't work as the "TO" value.
Orygunner
Thursday, September 25, 2014 6:21 PM -
Thanks to Microsoft Support tech Durgesh Jaiswal who worked with me online and discovered the problem. Someone in the past had created a second field with the same display name "Requested By" on the custom form used to trigger the workflow. This field had a type (Lookup) that didn't work as an email recipient. I did see both fields listed when I created the workflow and chose the email recipient, but thought they were referring to the same field since they had the same name. I assumed (incorrectly) there couldn't be two fields with the same name! It figures I had a 50/50 chance and happened to chose the wrong one. I assigned the recipient to the right one and now my workflow sends the email. To avoid this type of problem in the future, I went to the form and changed the second instance of the "Requested By" field (which wasn't being used anywhere on the form) to be "Requested By_new". MORAL OF THE STORY - make sure your custom field's Display Name is unique on that form!
Orygunner
Tuesday, October 21, 2014 11:54 PM