Create an email with a workflow in MS Dynamics Crm 2011 and dynamically fill in the To field

I am working on the development of Ms Dynamics Crm 2011, and I ran into the following problem. My situation:

I want to be able to automatically send emails after a change in a specific status field in the record of the "MyEntity" object. "MyEntity" has an email field. I am trying to create a workflow that sends email to the email field address in the "MyEntity" record after the status has been changed. My problem is that I cannot add the To field in the MyEntity field of the email address in the email creation workflow. I need to somehow specify in the workflow to dynamically add the "To" field, the associated email address from the specific "MyEntity". Is it possible? Is there a workaround for this? This can be done with the plugin, I think, but now I'm trying to avoid the plugin solution.

Thanks in advance

John

+2
source share
2 answers

Yes, you must be able to. First go to “Solutions”, pick up your object, go to “Fields”, pick up your email field and make sure the format is email. Publication.

Work: If you have more than 1 text box in the email format, temporarily change the rest (to text from email) and publish. Otherwise, the next step is ambiguous, and we do not have control over which CRM field is configured as an email for use when this object is used for email.

In the decision frame, select your node object in the tree. In the "Communication and interaction" section, check the box "Send an email message (if the email field does not exist, it will be created)." Save / Publish.

Correct the work above if you have more than 1 text box in the email format. Change them to email. Publication.

In Workflow, select your field. In the "Send Email" step, select "Set Properties." Select the To field. In the form helper, you cannot select your essence. NOTE. You are attached to the Key field and NOT to a specific email field.

This only works for a single email field on your custom object. You cannot use the text field as the address in the To field of the CRM.

+3
source

Sorry, you can’t.

In the To field of an email, only

  • Account
  • Contact
  • Facility
  • Leading
  • Queue
  • User

So, in order to achieve the goal, you will need to write your own workflow (optional: taking a custom text field in your input parameter) and take it to your workflow or develop a plugin.

Sample code for the plugin :

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

Check out this Crm 2011 post for more information : Workflow - Emailing Issues

0
source

Source: https://habr.com/ru/post/907955/


All Articles