Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Sunday, June 1
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Salesforce»Getting Salesforce Licenses Information

    Getting Salesforce Licenses Information

    Dhanik Lal SahniBy Dhanik Lal SahniAugust 23, 20199 Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Getting Salesforce Licenses Information
    Share
    Facebook Twitter LinkedIn Pinterest Email

    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
    apex License salesforce
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleRunning Salesforce App using Voice command – Speech-To-Text API
    Next Article Salesforce Winter 20 Release – Feature Enhancements for Einstein Bot
    Dhanik Lal Sahni
    • Website

    Related Posts

    By Dhanik Lal Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    View 9 Comments

    9 Comments

    1. Rahul Gupta on August 26, 2019 7:46 pm

      I have faced lot of issue while searching this using code. Thank you for sharing here.

      Reply
    2. Karish on May 27, 2020 3:47 pm

      How to get the total count assigned to my org of featured licences

      Reply
      • Dhanik Lal Sahni on May 31, 2020 1:17 am

        Hello Karish,

        You can add all features count to get it. Check https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htmhttps://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htm for all features.

        Thank You,
        Dhanik

        Reply
    3. NISHIT KEDIA on July 21, 2020 8:58 pm

      Thanks for sharing this article. This really helps.

      However, I need the total count of each feature licence available in the org or alternatively no. of feature licences remaining.

      Thanks,
      Nishit

      Reply
      • Dhanik Lal Sahni on August 1, 2020 9:36 pm

        Hello Nishit,
        PermissionSetLicense and UserLicense objects have this information. No of remaining features license can be retrieved through user object as these are added to user object.

        Thank You,
        Dhanik

        Reply
    4. SFDC Leaner on December 3, 2020 4:04 pm

      Please let me know about UserPermissionsAvantgoUser and UserPermissionsCallCenterAutoLogin

      Reply
      • Dhanik Lal Sahni on February 14, 2021 9:45 pm

        Hey Siddhartha,

        What do you want to know about UserPermissionsAvantgoUser and UserPermissionsCallCenterAutoLogin? Please specify your question.

        Thank You,
        Dhanik

        Reply
    5. Kumar Vivek on January 11, 2021 4:10 pm

      How can we get the User License expiration Date? Any help is appreciated.

      Reply
      • Dhanik Lal Sahni on February 14, 2021 9:44 pm

        Hey Vivek,

        You can refer this post

        Thank You,
        Dhanik

        Reply
    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.