Salesforce is phasing out the getRoleAndSubordinates() method as part of the Winter '26 release. This method will stop working in
Spring '26, potentially breaking your applications.
The getRoleAndSubordinates() method has been replaced by getRoleAndSubordinatesInternal() to provide better internal
handling of role-based sharing groups. Both methods return the same data - a set of user IDs that includes the current user and all users in
subordinate roles.
Using the deprecated method creates technical debt and puts your code at risk of runtime failures when Salesforce removes support for the old
method.
What is the potential impact?
Applications using the deprecated method will experience runtime errors and broken functionality once Salesforce removes support in Spring '26.
This can affect:
- SOQL queries that filter records based on role hierarchy
- Security and sharing logic that depends on role-based access
- Reports and dashboards that use role-based data filtering
- Any business processes that rely on hierarchical data access