tags:

views:

375

answers:

3

Hi,

I created a workflow . My workflow sends e-mails to users who has salesperson security role. But I have big problem. After I export and import customizations in different company users of old company are shown on the e-mail template. How can I create a worflow which sends e-mail to users who has selected security role.

Regards, Erdogan Uslu

+1  A: 

The workflow editor isn't that powerful. You can't select a bunch of users with certain attributes and apply an action to them. You'll have to create a custom workflow activity. Run as the admin user to retrieve the list of users with a certain role. Base it off the SDk article Retrieve the Roles for a User

You would need to reverse this expression, so to speak. Add a condition expression on the role link, to match on the role name. Then you would remove the condition expression from the system user link. Make the role link a child of the system user link (right now the systemuser is a child of the role link). Change qe.EntityName to "systemuser".

You'll then need to create an e-mail. See SDK articles on sending e-mail and creating workflow activities. Hope this helps.

benjynito
A: 

Using a security role like that is quite a weak mechanism for grouping users. CRM has the concept of a Team. Can't you create a Team, then send your email to the team?

Tim Long
A: 

I tried the proposed team solution and from a workflow you cannot send an email to a team using workflow.

Heti