function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neha Arora 50Neha Arora 50 

Task Assignment based on roles

HI,

I have created a workflow rule, in which a task should be created for all the users who are in CEO role. There are two 2 users under this role and task should be assigned to both the users.

Based on the specified criteria when I create a record, workflow rule is triggerd and but task is created for the user who have created that record i.e., Assigned To Id (Task) = Creted By (Main Object from which workflow rule is triggered).

I have tried to implement the same approach with the process builder too, and assigned the Role ID to the Assigned to Id field of task but it gives me an error and does not let me to sve the record. 

This is the error I was getting - 
We can't save this record because the “Record Name” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: MALFORMED_ID: Assigned To ID: id value of incorrect type: 2F00Ec00000011UtU. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 296214298-72703 (1978889399)ook up ExceptionCode values in the SOAP API Developer Guide. Error ID: 296214298-72703 (1978889399)

PriyaPriya (Salesforce Developers) 

Hi Neha,

Hi,
It seems you are asigning text value to Lookup field somewhere.
Please assign record ID to lookup field instead.

Please share screnshot of assignment for details.

regards,

Priya Ranjan

Neha Arora 50Neha Arora 50
Hi Priya 
Thank you for your efforts, but the problem I was facing it was because of salesforce limitation.

Found this limitation -- 
If the assignee of a workflow task is a role and more than one user belongs to that role, the record owner becomes the task assignee, regardless of their role. We recommend that you don’t assign tasks to roles with multiple users. Assigning tasks to roles with one user allows you to easily change the user in that role without modifying the workflow rule. If the assignee of a workflow task is a role and that role is empty, the record owner becomes the task assignee, regardless of their role.

referring this post
https://help.salesforce.com/articleView?id=sf.customize_wftasks.htm&type=5 (https://help.salesforce.com/articleView?id=sf.customize_wftasks.htm&type=5)