0

I have a Salesforce role hierarchy structured as follows:

- GrandFather
  - Father
    - Child1
      - GrandChild1
        - GrandGrandChild1
        - GrandGrandChild2
      - GrandChild2
        - GrandGrandChild3
    - Child2
        - GrandChild3
    - Child3
        - GrandChild4
          - GrandGrandChild4
          - GrandGrandChild5

Each role in the hierarchy has "GrandFather" as its parent role. I want to reorganize the hierarchy by removing "GrandFather" and making "Father" the top-level role.

What are the necessary steps to achieve this? If there are any pitfalls or challenges?

I have tried to execute a script which changes ParentRoleId field for every role under GrandFather, but it fails with such error:

FIELD_INTEGRITY_EXCEPTION, Cannot modify system-maintained portal role field: Parent Role ID: [ParentRoleId]
0

1 Answer 1

0

You write that

Each role in the hierarchy has "GrandFather" as its parent role.

I don't think that's correct, because then you would have an almost flat structure like this:

- GrandFather
 - Father
 - Child1
 - GrandChild1
 - GrandGrandChild1
 - GrandGrandChild2
 - GrandChild2
 - GrandGrandChild3
 - Child2
 - GrandChild3
 - Child3
 - GrandChild4
 - GrandGrandChild4
 - GrandGrandChild5

A few points to understand about a role hierarchy

  • The top level role in any Salesforce org's Role Hierarchy is by default the Organization Name (found under Settings -> Company Settings -> Company Information)
  • If you want to change the name of this top level, you need to change the Organization Name

If you have the structure you showed, and "Grandfather" is the top level role, you cannot do what you are trying to do.

However, if "Grandfather" is NOT the top level in your hierarchy, then all you need to do is go to all of your "Father" roles and set the parent to whatever the parent of "Grandfather" is.

2
  • @larawazowski you understand me not correctly. Of course the top level role in any Salesforce org's Role Hierarchy is by default the Organization Name, but next role to it is GrandFather. Every role under it has its ParentRoleId. Oct 24, 2023 at 15:22
  • OK, so then you should be able to "reparent" by changing the Parent for only the Father roles - not all roles. Oct 24, 2023 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .