Dynamics CRM Sending emails in Round Robin Fashion.

I have requirement to Send a Work Flow email to 2 different email addresses in a Round Robin mode. By this the first email to go to address 1 and the second will go to address 2 in a RR fashion at a time.

I am running CRM 2011.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

Adding workflow steps to create an Send Email will let you create an email and define the "To" address.

Just add 2 different steps to send email with different email address. This will be executed as one after another (in a Round Robin fashion).
GulfITAuthor Commented:
But i need only one Send email only to one address at a time. One per WF.
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

I am confused. Give us some information:

1. Is the email same? for both users?
2. Is the email body same all the time?
3. Do you want to send email from single workflow? Or want to send with different workflow?
4. Is there any condition when you need to send email for each of them?
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

GulfITAuthor Commented:

I have 2 external venders that we need to send information from CRM to do some checks on. So when sending the emails the 2 venders have to get on 50/50 ratio.

Therefore when the WF emails are triggered the first email needs to go to vender 1 and when the next WF triggeres email needs to go to vender 2.

Hope this helps to understand.
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

I am quite unsure if I understand your requirements. But when you add different steps in workflow to send email to different recipients, all the process to send emails is done in round robin fashion only.

If your email body is limited/static, you can go for a template and define the step to send email from template also. You just have to define Vendors' email addresses.
GulfITAuthor Commented:
WF1 (Triggers when a Option Set is selected)

I have 2 Venders vender1@Venderdomain.com and Vender2@Venderdomain.com.

When WF1 triggers for the first time it sends a email to vender1@Venderdomain.com. WF Ends.

When the WF1 triggers for the second time it sends a email to vender2@Venderdomain.com. WF Ends.

Hope this could get the understanding going.
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Okay. You can take a boolean/optionset attribute where you will update the value according to WF has been triggered.

Lets say, WF1 triggered for the first time, update the value to Vendor1 Email Sent.
Now when WF1 triggers second time, check the value of OptionSet or Boolean and create a conditional branch. If Vendor1 Email already sent, you know what you have to do.

I hope this will clear your doubts.
GulfITAuthor Commented:
But the value getting updated will be related to that particular opportunity and any entities related to that opportunity only.

If the WF triggers against another opportunity which is totally different then it will not have a relative lookup.
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
nope. it will trigger to same Opportunity only.
Jeff WightBusiness Solutions ManagerCommented:
Are your 2 vendors set up as CRM records, like an Account or Contact?  If so, I think something like this would do what you want:

On the Vendor record type, create a custom field called something like "On Deck".  Make it something like a two-value option (or a string or whatever works for you).  Update one of your vendor records to set it's "On Deck" value to "Yes" and the other two "No".

Create 2 new relationships between the opportunity and the Vendor record Type.  Call them something like "Potential Vendor 1" and "Potential Vendor 2".

Create a new workflow that triggers when an opportunity where these vendors would be used is created.  Use the workflow to set "Potential Vendor 1" = to your first Vendor record and "Potential Vendor 2" = your second Vendor record.

Now, when your original option set value changes and your original workflow is triggered, create a conditional branch to check to see if the Vendor record in "Potential Vendor 1" is "On Deck":
If yes, do the following:
Send the email to the Vendor Record in "Potential Vendor 1"
Update the Vendor record in "Potential Vendor 1" to have "On Deck" = No
Update the Vendor record in "Potential Vendor 2" to have "On Deck" = Yes

If no, do the following:
Send the email to the Vendor Record in "Potential Vendor 2"
Update the Vendor record in "Potential Vendor 2" to have "On Deck" = No
Update the Vendor record in "Potential Vendor 1" to have "On Deck" = Yes

You could also create another relationship that stores the selected Vendor for the opportunity and populate that with the On Deck vendor when your option set workflow is fired.

That should do it.  This isn't tied to specific opportunities because it uses the actual vendor records to store who is "On Deck".  It would be cleaner to do this with a custom workflow extension, but the solution described above does everything you want without any custom development.  If anything isn't clear or if I missed a requirement, please let me know.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GulfITAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.