function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
WesNolte__cWesNolte__c 

Query number of customer portal user licenses currently allocated.

Hello

 

Any ideas how I might know the max and current number of license within an Org? I'd like to redirect to a custom page if I've run out.

 

Cheers,
Wes

aalbertaalbert

I don't know of any way through Apex or the API to query the licenses (available nor active). But if you insert a User object and exceed the limit, the error message is something like "LICENSE_LIMIT_EXCEEDED". You could catch that type of exception and redirect to the custom page, perhaps. 

 

 

arunkarunk

Hi,

 

 

I dont think this can be done through APEX.

But you can view the licence usage for your org by checking

Setup> Administration Setup > Company Profile > Company Information

Check the User Licenses section in this page.

 

 

Regards,

Arun 

WesNolte__cWesNolte__c

Yeah I thought of using each of those, but I'd like to start sending warning emails when I get down to my last 10, 5, 3, 1 licenses.

 

Thanks for trying though.

 

Wes