I have a requirement to automate the role hierarchy assignment process to Users present in Salesforce. It will be based on field value recorded on User record with some condition.
For example:- If person reports to a role = 'ABC' Then Role = ABC_Team If person does not have reporting then role = < User.FieldValue >-Team
If Role Name does not exist, the create it. Then Assign it.
What i have tried so far:-
- I tried with Process Builder but No luck.If there is any way, Let me Know? I did not find any option to assign the role to the user in action after setting the criteria.
- Workflow also did not give us any hope.If there is any way, Let me Know?I did not find any option to assign the role to the user in action after setting the criteria.
- I have option with writing triggers or batch class to automate it but if there is any thing available that saves me writing that much code.
Update:- Yes, I need the process to be executed during user creation as well as for the updates done on Users later too.
How we create Users? ->> We got users in inactive state with chatter profile from third party to Salesforce. We have some approval process and batch class running to make it active.