How to query users with Salesforce User License?

How to query users with Salesforce User License?

Using SOQL:

SELECT Id, Name, Alias
FROM User
WHERE IsActive = true
AND  Profile.UserLicense.Name = 'Salesforce'

Using Report:

1. Go to Setup –> Customize –> Users –> Fields –> Create New Field.

2. Select “Formula” as the data type and “Text” as return type.

3. Use “Profile.UserLicense.Name” in the formula editor.

4. Save the formula field.

5. Use the formula field in the report.

Leave a Reply