You need to sign in to do that
Don't have an account?
Getting server error while assigning a role to a user
Hello All,
I have a role hierarchy in my SFDC org, I can assign a particular role to a new user but I am getting an error when I am trying to assign that role to a user in a scratch org. There is no error in Sandbox and Production. Erro is occurring only in Scratch org.
Let me share with you a dummy hierarchy below
So the issue is with C level (C1,C2,C3) If I assign any of these roles to a user it's giving the below error. This issue is occuring in scratch org, otherwise, in Sandbox and Prod, it's working fine.

Thanks.
Vineet
I have a role hierarchy in my SFDC org, I can assign a particular role to a new user but I am getting an error when I am trying to assign that role to a user in a scratch org. There is no error in Sandbox and Production. Erro is occurring only in Scratch org.
Let me share with you a dummy hierarchy below
Thanks.
Vineet
Kindly refer below docs:
https://trailblazer.salesforce.com/issues_view?id=a1p3A0000018BvaQAE&title=cratch-orgs-hit-internal-server-error-when-trying-to-add-a-role-to-a-user-record-in-the-newly-created-org
If it helps,please mark as Best Answer so that it can help others in future.
Thanks!
I could find that this is a pretty common issue with scratch orgs, particularly if your org is generated with
hasSampleData: false
.Please check the discussion and suggestion over similar thread here (https://salesforce.stackexchange.com/questions/288831/error-when-adding-role-to-my-user-in-a-scratch-org), if it helps.
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.