function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kirill_YunussovKirill_Yunussov 

How to access the "User License" field on User via Apex?

I want to monitor changes to this field using a trigger, but cannot figure out where it's located.  This field only seems to be available via UI and API.

Best Answer chosen by Admin (Salesforce Developers) 
Leon MorockiLeon Morocki

You can use User.Profile.UserLicense.Name

All Answers

Leon MorockiLeon Morocki

You can use User.Profile.UserLicense.Name

This was selected as the best answer
Stefan Mationg 7Stefan Mationg 7
Thanks @Lean Morocki!