Quick answer for interviewers
Before deleting a role in Salesforce, check whether any active users are assigned to that role — removing a role with assigned users can change those users’ data visibility and break business processes that rely on that role.
Why this matters
Roles control record-level visibility through the role hierarchy and can affect sharing, reports, dashboards, and automation (flows, apex, approval processes) that reference role-based criteria. If users still have the role, deleting it may remove their expected access or leave automation referencing a now-nonexistent role.
How to verify assigned users (example)
Run a simple query to find users assigned to the role before deletion:
SELECT Id, Name, Email, UserRoleId FROM User WHERE UserRoleId = '00EXXXXXXXXXXXX'
Practical checklist
- Confirm no active users are assigned (or reassign users first).
- Search for references to the role in sharing rules, Apex code, flows, approval processes, and reports.
- Validate expected data visibility in a sandbox before making the change in production.
Answering this succinctly in an interview shows you understand both the technical and business impact of role changes in Salesforce.
Leave a Reply