1

Thanks. I am trying to fetch UsedLicenses / TotalLicenses from UserLicense object and I am using API 32.0 but when I try to access those fields, error says "No such column 'TotalLicenses' on entity 'UserLicense'.I checked with Salesforce Support and as per them these fields are enabled for our orgainsation. But then When I have tried to understand object details with ObjectDescribe using Workbench, I am not able to find these fields. Is anyone here able to get these field details. if so how? 3. How can we ensure these fields are enabled for us? Pls help.

  • Possible duplicate of salesforce.stackexchange.com/questions/60637/… – BarCotter Feb 13 '15 at 11:33
  • Hi Devi, What are you trying to ask here? Are you looking for other users that are in the UserLicense pilot program if they are able to query the TotalLicense column? FYI the documentation gives the column name as TotalLicenses not TotalLicense (or totollicense as you mentioned in your question) – BarCotter Feb 13 '15 at 11:35
  • Hi All, Thanks. I am trying to fetch UsedLicenses / TotalLicenses from UserLicense object and I am using API 32.0 but when I try to access those fields, error says "No such column 'TotalLicenses' on entity 'UserLicense'. please suggest. I checked with Salesforce Support and as per them these fields are enabled for our orgainsation. But then When I have tried to understand object details with ObjectDescribe using Workbench, I am not able to find these fields. Is anyone here able to get these field details. if so how? 3. How can we ensure these fields are enabled for us? – Devi Feb 16 '15 at 16:50
0

These fields are available only through API call. You have to make Webservice SOAP Call to retrieve them.

Also you can vote for this idea to make these fields Generally Available AND available through Apex Code, SOQL, Developer Console and Workbench.

Also you might be interested in this idea.

==== Update ====

I created a managed beta package which may serve as workaround for this. It screenscrapes company profile page and gets number of total license.

This package includes a User_License_Extended__c custom object which contains Total License number and Used Licenses number ( and some more fields ), these numbers are updated whenever a user is activated or deactivated or user profile is changed assuming package is properly set up with necessary data

Install link for production-like org https://login.salesforce.com/packaging/installPackage.apexp?p0=04t580000001ENa

More details and release notes https://patlatus.wordpress.com/2016/03/07/salesforce-uletas-beta-1-0-release-notes/

| improve this answer | |
0

I would've prefered to leave a comment, but because my reputation is not high enough I couldn't. This is my first answer post. I have a workaround that should help you get the results you need since you have not been successful in accessing that TotalLicense field. You could query the UserLicense object in Workbench and export it to Excel with the Bulk CSV option in Workbench.

SELECT Id, LicenseDefinitionKey, MonthlyLoginsEntitlement, MonthlyLoginsUsed, Name, SystemModstamp FROM UserLicense

Then you could query the Profile Object and export to Excel using the Bulk CSV option.

SELECT Description, Id, IsSsoEnabled, LastModifiedDate, Name, UserLicenseId, UserType FROM Profile

Use VLookup in Excel to match the UserLicenseId column on the Profile table with the ID column on the UserLicense table to return the Name column value from the UserLicense table to the Profile table. Name that column License Name on the Profile table.

Go back to Workbench and query the User object and export it to Excel using the Bulk CSV option.

SELECT Id, IsActive, Name, ProfileId, UserType FROM User WHERE IsActive=True

Use VLookup to match the ProfileId column on the User table with the Id column on the Profile table to return the License Name to the User table. then you could use count functions and sorting to get the total number of each license. Hopefully that makes sense. If you need VLookup instructions I could provide those as well if you need help. Hopefully this is helpful.

| improve this answer | |
  • This gives you the licenses used, which you can also get from: SELECT COUNT(ID), Profile.UserLicense.Name, Profile.UserType FROM User WHERE IsActive = true GROUP BY Profile.UserLicense.Name, Profile.UserType – user735 Apr 9 '15 at 22:31
  • Would love to know how to get get the total available licenses - haven't figured that one out yet ... – user735 Apr 9 '15 at 22:32

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.