0

Recently I enabled Partner Community for one of existing Accounts. As I noticed the new Role was created with the similar name of my Account - I assume this role can be used to share records with recently created Partner Account's employees (partner users)

Q: How to exactly determine Partner Community Role by Account Id? Is there any link between Partner Account and automatically created Role?

1
  • On Account, which related list are you referring to?
    – Raul
    Commented Feb 13, 2017 at 14:16

1 Answer 1

2

Found the reference to partner account in UserRole object. So in order to get automatically created Group for Partner Account you will need to do something like:

UserRole portalRole = [SELECT ParentRoleId FROM UserRole WHERE 
    PortalAccountId = :portalAccount.Id 
    LIMIT 1];
Group partnerPortalGroup = [SELECT Id, Name, 
    DeveloperName, RelatedId, Type, Email 
    FROM Group WHERE 
    RelatedId = :portalRole.Id];

You must log in to answer this question.

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