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:-

  1. 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.
  2. 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.
  3. 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.

  • Can you elaborate automating role hierarchy assignment? Are you saying that you need to assign a role to the user during user creation? How are the Users being created - using UI/bulk/API? When you say you have tried with PB or Workflow, what have you tried and what did not work? – Jayant Das Jan 16 '19 at 15:09
  • @JayantDas I have updated my question. – sanket kumar Jan 16 '19 at 15:31

You'll have to go to either Flow or Apex for this, and I would definitely choose Apex myself.

You will not be able to perform a lookup for existing Roles followed by conditional creation of a new Role followed by assignment of that Role to the User who started the process within Process Builder. It simply doesn't have those capabilities.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.