Create Email with a workflow in MS Dynamics Crm 20

2019-05-27 01:48发布

I'm working on Ms Dynamics Crm 2011 development and I encountered following problem. My situation:

I want to be able to automatically send an Email after a change on a specific status field on a record of the Entity "MyEntity". "MyEntity" has an Email-field. I try to create a workflow which sends an Email to the Email-field address of the "MyEntity" record after the status has been changed. My problem is that I can't add in the Email Creation workflow to the "To" field this "MyEntity" Email-field adress. I need to somehow specify in the workflow to dynamically add the "To" field, the relating Email address from the specific "MyEntity". Is that possible? Is there a workaround for that? It could be done with a plugin I guess, but by now I'm trying to avoid the plugin solution.

Thanks in advance

John

2条回答
对你真心纯属浪费
2楼-- · 2019-05-27 02:30

Unfortunately you cannot.

Out of the box the To field in an email accepts only

  • Account
  • Contact
  • Facility/Equipment
  • Lead
  • Queue
  • User

So in order to achieve the goal , you will have to write a custom workflow activity (optional : taking the custom text field in your input parameter )and refer it in your workflow or develop a plug-in.

Sample code for Plugin:

SendEmailRequest req = new SendEmailRequest();
req.EmailId = emailId;//ID of created mail
req.TrackingToken = "";
req.IssueSend = true;

For more information check this post Crm 2011 :Workflow - Sending email problem

查看更多
闹够了就滚
3楼-- · 2019-05-27 02:31

Yes, you should be able to. First go to Solutions, bring up your entity, go to Fields, bring up your e-mail field and ensure the Format is e-mail. Publish.

Work around: If you have more than 1 e-mail Format text field, change the others temporarily (to text from e-mail) and Publish. Otherwise, the next step is ambiguous and we don't have control over which field CRM sets up as the email to use when this entity is used for e-mail.

In the solution frame, select your entity node in the tree. Under Communication and Collaboration, check the box 'Sending e-mail (If an e-mail field does not exist, one will be created).' Save/Publish.

Fix the work around above if you had more than 1 e-mail format text field. Change them back to e-mail. Publish.

In Workflow, select your To Field. Under the Send e-mail step, select 'Set Properties.' Select the 'To' field. In the form assistant you should not be able to select your entity. NOTE: You will bind to the 'Key' field and NOT to the particular e-mail field.

This only works for a single e-mail field on your custom entity. There is no way to use a text field as an address in a CRM 'to' field.

查看更多
登录 后发表回答