I need to Share a User record with another Team(Access team) programmatically. I am unable to do it using GrantAccessRequest class. Is there a way to achieve this? Share button is not available in User Record form. When I try to enable Access teams for User it throws the below error.
<ErrorCode>-2147192819</ErrorCode><Message>Entity with logical name systemuser is not user owned and cannot be enabled for access team creation</Message>
Could anyone please help me?
*This post is locked for comments
Hi Vignaesh,
you should have the users in separate business units under same parent. so you can achieve the requirement by giving read access at business unit level
Are both teams in same BU?
If both of these teams are in the same Business Unit, you wont be able to achieve this out of the box, you can create separate view but then they can find through advance find or lookup on records and be able to edit user anyway.
If you want to achieve this with one BU, you can write a plugin, this could trigger on update, if the updating user is not part of Team A, then throw Invalid Plugin Execution Exception with a message
Thanks Kokulan. Actually my requirement is this. I have 2 teams - Team A and Team B. Let's say we have 50 users. Team A should see 25 users and Team B should only see the remaining 25 users. Is this achievable?
You can only use Access Team for Team or User owned entities, you cannot use it for Org/BU owned entities.
I know there is an option to enable Access Teams for User entity but its of no use because Ownership is BU
And the reason it fails for GrantAccessRequest is that User entity does not support Share privilege, please see below
I would say create separate sec role just to give enough permission for user management and assign that to a team or user to give them necessary permission. You could give just BU level permission if you have BUs set up
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156