SEL_Profile
Class · Group: Selectors
apex
global inherited sharing class SEL_Profile extends SEL_BaseExtends: SEL_Base
Selector for the Profile SObject. Provides default field configuration, query methods, and commonly used profile name constants.
Since: 1.0
Example:
apex
Profile adminProfile = new SEL_Profile().findByName('System Administrator');
Profile standardUser = new SEL_Profile().findByName('Standard User');
Profile profile = (Profile)new SEL_Profile().findById(profileId);See Also: SEL_Base
Methods
| Method | Description |
|---|---|
| global Profile findByName(String profileName) | Finds a Profile record by name. |
| global override List getFields() | Returns the core fields for Profile queries. |
| global SEL_Profile() | Constructs a Profile selector with the Profile SObjectType. |
Method Details
SEL_Profile
apex
global SEL_Profile()Constructs a Profile selector with the Profile SObjectType.
Since: 1.0
Example:
apex
SEL_Profile instance = new SEL_Profile();findByName
apex
global Profile findByName(String profileName)Finds a Profile record by name. Results are cached within the transaction to avoid repeated SOQL queries for the same profile.
Parameters:
profileName(String) - The name of the profile to retrieve
Returns: Profile - The matching Profile record, or null if not found
Since: 1.0
Example:
apex
Profile adminProfile = new SEL_Profile().findByName('System Administrator');getFields
apex
global override List<SObjectField> getFields()Returns the core fields for Profile queries.
Returns: SObjectField - List of Profile SObjectField tokens
Since: 1.0
Example:
apex
List<SObjectField> result = instance.getFields();