We have a requirement to fetch the complete list of User Licenses available in Company Information page and display it on a custom VF page.

We are using the same approach as mentioned in Getting remaining licenses of customer portal using apex post. However we are not able to get the complete list of licenses in one go. Instead we get the Show 10 More link.

This is probably because the screen scraping is done only on the visible information. If we expand the Company Information Page by clicking on the Always show me Fewer / Show More records per related list, we are able to get the complete list of User Licenses and only in this case we get the complete list in our VF page.

Can anyone please help us in how to retrieve the complete list of User Licenses? Or how can we achieve the hyperlink clicking event from within the Apex.

Thanks in advance.

1 Answer 1


You can use this SOQL to query all user licenses in your org.

SELECT Id, Name FROM UserLicense
  • Hi Reshma. Thanks for your answer. But we want to show the total number of licenses available and Remaining Licenses information as well. These fields on User License object are not available by default and we need to enable a pilot program for this from Salesforce which is taking a lot of time. So our only option available is by using the screen scraping approach.
    – Sam
    Aug 30, 2016 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.