+ Start a Discussion
Luke Vang 52Luke Vang 52 

UserLicense Object - Winter 18

The winter 18 release notes say:

The UsedLicensesLastUpdated field was added.
The following fields are now generally available: MasterLabel, Status, TotalLicenses, UsedLicenses.

Does this mean we can finally query this object with enrolling in the special pilot program? 

NagendraNagendra (Salesforce Developers) 
Hi Luke,

Yes, you are right.

Users with the “View Setup and Configuration” permission can use the UserLicense object to view the set of currently defined user licenses in your organization.

The UserLicense object is currently used by bulk user creation to determine the user license to which each profile and permission set belongs. For example, if you use the API to create portal users and you want to know which profile belongs to each portal user license, you can query this object for each profile and check the LicenseDefinitionKey to identify the associated user license.