When I log into Salesforce UI to add a user, I only see 9 licences in the userlicense drop down. But when I go to the profiles section I can see 23 licenses. Why is that? Based on what criteria does Salesforce populate the license drop down in add user page.
My main issue is that User License drop down in add New User page does not show "Salesforce" user license. Whys is that?
I need to give similar functionality via the Api. Therefore I need to get only licenses/profiles displayed available for add new User.
So far I am using, var profileQry = await client.QueryAsync("SELECT Description,Id,Name,UserLicenseId FROM Profile");
var licenseQry = await client.QueryAsync<Object>("SELECT Id,Name,TotalLicenses FROM UserLicense");
QUESTION UPDATED WITH A NEW SCENARIO - 01st Feb 2016
It's clear that if there are no available license the add new user drop down does not show those license types (as correctly mentioned by Tushar Sharma). But that solves part of the problem.
My updated question (scenario) is, Why "Salesforce Platform", "Customer Community Login","Authenticated Website" etc. license types not appearing in the "Add new user" drop down even though there are available licenses?
How can I query that list (options available for New User) via the api? (whhat should be the where condition for the following query)
var profileQry = await client.QueryAsync<Profile>("SELECT Description,Id,Name,UserLicenseId FROM Profile");
Highly appreciate any help on this.