Skip to content

SEL_Profile ​

Class · Group: Selectors

apex
global inherited sharing class SEL_Profile extends SEL_Base

Extends: SEL_Base

Selector for the Profile SObject. Provides default field configuration, query methods, and commonly used profile name constants.

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 ​

MethodDescription
global Profile findByName(String profileName)Finds a Profile record by name.
global override List<SObjectField> getFields()Returns the core fields for Profile queries.

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

ParameterTypeDescription
profileNameStringThe name of the profile to retrieve

Returns Profile — The matching Profile record, or null if not found

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

Example

apex
List<SObjectField> result = instance.getFields();

Constructors ​

ConstructorDescription
global SEL_Profile()Constructs a Profile selector with the Profile SObjectType.

SEL_Profile() ​

apex
global SEL_Profile()

Constructs a Profile selector with the Profile SObjectType.

Example

apex
SEL_Profile instance = new SEL_Profile();