ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Admin questions28 of 50
AdminMedium 2 min read

What role do Public Groups play in streamlining administrative sharing and queue configurations?

Answer

Basics: Instead of naming individual users in every sharing rule, create a group such as "EMEA Support", then target it. When people join or leave, you update the group, not every rule.

How it works: Setup > Public Groups > New. Add members (users, roles, roles and internal subordinates, portal roles, other public groups). Then pick the group as the target of sharing rules (share with), as members of a queue, in manual sharing, in report/dashboard/email template folder access, list view visibility and approval assignments. Group membership changes trigger sharing recalculation, which may be deferred for big orgs.

Advanced / deep dive: The "Grant Access Using Hierarchies" checkbox on a group decides whether managers above members inherit access; leaving it on is default but may over-share. Groups and members are stored in Group and GroupMember, which are setup objects, so inserting them together with users or other business records in one transaction raises a mixed DML error; split into separate async transactions. Queues are a special group type. Nested groups make administration easy but can slow recalculation and hide who has access, so documenting is key. Alternative for dynamic membership: permission set groups and territory management for access that depends on attributes, though they do not replace sharing groups.

Code / config example:

apex
// Query user members of a public group (direct members only)
Group g = [SELECT Id FROM Group WHERE DeveloperName = 'EMEA_Support' AND Type = 'Regular' LIMIT 1];
List<GroupMember> members = [SELECT UserOrGroupId FROM GroupMember WHERE GroupId = :g.Id];

Hidden gotchas & must-remember points:

  • Mixed DML error occurs when GroupMember and standard/custom objects are updated in one transaction.
  • Queries return only direct members; nested group members need recursion.
  • "Grant Access Using Hierarchies" can unexpectedly give managers access.
  • Large membership changes cause sharing recalculation, which may take time.
  • Public groups are not the same as Chatter groups.

Best practice: Name groups by purpose, keep nesting shallow and prefer groups over named users in sharing rules.

AdminPublic GroupsUser Collections
Practice SOQL & Apex
PreviousHow do Lookup relationships differ from Master-Detail relationships in terms of record dependency and security?Next How do Summary reports organize data groupings and subtotal calculations for business users?

More Admin questions

  • How do Dynamic Dashboards leverage running user security contexts to personalize dashboard data views?
  • What is a Hierarchical relationship and what unique object limitation does it possess in Salesforce?
  • What are Organization-Wide Defaults (OWD) and how do they establish baseline data security in Salesforce?
  • How does the Role Hierarchy interact with OWD settings to grant vertical record visibility?
  • What is the operational difference between owner-based and criteria-based sharing rules in Salesforce?