You need to sign in to do that
Don't have an account?
Find users under under in role hierarchy and update the same user on user picklist
Following is my requirement Please Help Me.
I want to write an Apex Trigger based on Particular Role Hierarchy (XYZ is my role Name). If the users are not blank in XYZ Role then fetch those users and add the same users in ABC object's field User(This is a custom picklist field of ABC object).
Can anyone help me to achieve this Many Thanks in advance.
if we add/delete/Update user in XYZ roles then same will reflect on the ABC objects picklist fields named as User.
I want to write an Apex Trigger based on Particular Role Hierarchy (XYZ is my role Name). If the users are not blank in XYZ Role then fetch those users and add the same users in ABC object's field User(This is a custom picklist field of ABC object).
Can anyone help me to achieve this Many Thanks in advance.
if we add/delete/Update user in XYZ roles then same will reflect on the ABC objects picklist fields named as User.
Step 1 : Write a trigger on User object with events insert/update/delete.
Step 2 : Get your XYZ role id using query! Step 3 : Check this role id is equal to user role id whome you are going to insert/update/delete! Its just the way you can think! It may not work exactly!
And also you can refer : https://developer.salesforce.com/forums/?id=906F00000008z93IAA
Please let me know if it doesn't work!
Regards,
Edanna.