February 9, 2021

How to get User License Name from User object in Salesforce?

Sample SOQL using Apex:

for ( User objUser : [ SELECT Id, Name, Profile.UserLicense.Name FROM User WHERE Profile.UserLicenseId != null ] )
    system.debug( objUser.Profile.UserLicense.Name );
 
Output:



No comments:

Post a Comment