Tag:

License

    Getting Salesforce Licenses Information

    Our Salesforce Org has lot of license for different kind of application and features installed in Org. These details can easily be checked using Setup-> Company Information.  In this post , I will list out detail to find licensing information using SOQL.

    User License:

    This object is used to show features which user can access. User permission is assigned using Profile or Permission Set.

    Requirement : Find List of All Used and Remaining User License in Org
    Solution:
    SELECT MasterLabel,Name,Status,TotalLicenses,UsedLicenses,UsedLicensesLastUpdated FROM UserLicense

    Permission Set Licenses:

    Permission set license is used to assign permissions to use various tools and functions which are not included in User License. We can use permission set licenses to grant access, but not to deny access.

    Requirement : Find List of All Used and Remaining Permission Set License in Org
    Solution:
    SELECT MasterLabel, ExpirationDate,TotalLicenses, UsedLicenses FROM PermissionSetLicense

    Feature Licenses:

    A feature license entitles a user to access an additional feature that is not part of user license, such as Marketing or Service Cloud User. Users can be assigned any number of feature licenses.

    Requirement : Find List of All Used Features License in Org
    Solution:

    There is no object which expose these detail. As these features are added to user so, we can use User object to find most of features count.

    Available Features Licenses

    • Chatter Answers User
    Select count() From User where UserPermissionsChatterAnswersUser=true and isActive=true
    • Flow User
    Select count() From User where UserPermissionsInteractionUser=true and isActive=true
    • Knowledge User
    Select count() From User where UserPermissionsKnowledgeUser=true and isActive=true
    • Chat User
    Select count() From User where UserPermissionsLiveAgentUser=true and isActive=true
    • Marketing User
    Select count() From User where UserPermissionsMarketingUser=true and isActive=true
    • Offline User
    Select count() From User where UserPermissionsOfflineUser=true and isActive=true
    • Salesforce CRM Content User
    Select count() From User where UserPermissionsSFContentUser=true and isActive=true
    
    • Service User
    Select count() From User where UserPermissionsSupportUser=true and isActive=true
    August 23, 2019 1 comment
    1 Facebook Twitter Google + Pinterest