2

I need to identify licenses that have remaining licenses. Referring to UserLicense object, I need to write a query to retrieve license that returns where (TotalLicenses - UsedLicenses) > 0.

I am using .Net client and Api version 34. Following query works for get all license, (Working)

var licenseQry = await client.QueryAsync<Object>("SELECT Id,Name FROM UserLicense"); 

But (Not working)

var licenseQry = await client.QueryAsync<Object>("SELECT Id,Name,TotalLicenses FROM UserLicense") 

does not work. Throws an error sating invalid column.

Am I missing something?

This question is a follow up question from this question.

2
  • May be this will help count remaining license Commented Dec 16, 2015 at 4:21
  • That one is based on apex. I am using the REST api client. Commented Dec 16, 2015 at 4:25

1 Answer 1

2

I got that same error message when I tried to query that field through the REST api as well:

$ curl https://ap4.salesforce.com/services/data/v34.0/query/?q=SELECT+Id,Name,TotalLicenses+FROM+UserLicense -H 'Authorization: Bearer 

In the salesforce object reference guide, it mentions that:

This field is available through the API Access to User Licenses pilot program. For information on enabling this pilot program for your organization, contact Salesforce.

screenshot

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.