0

I came across this issue when trying to add a role to my own user, in order to have the account serve as a community account for community user provisioning. I also tried creating another admin with the role set from the get-go but same issue. Anybody else seen this?

enter image description here

  • Created a custom Role and all fixed, go figure – Glen De Marcos Dec 18 '19 at 22:53
0

This is a pretty common issue with scratch orgs, particularly if your org is generated with hasSampleData: false. It comes up any time you assign one of the built-in Roles to any User and it's always a gack.

I typically begin scratch org builds that use hasSampleData: false with a little Anonymous Apex:

delete [SELECT Id FROM UserRole];
UserRole ur = new UserRole(Name = 'CEO');
insert ur;
update new User(Id = UserInfo.getUserId(), UserRoleId = ur.Id);
| 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.