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
danwilkiedanwilkie 

How to query the maximum number of user licenses in apex code

We have a set number of customer portal user licenses available, and we would like to take action when we reach this limit (or ideally when we get near this limit but have not yet reached it).

 

I think it is possible to find out the number of cp licenses currently in use (select users where the isActive=true and the profile is Customer Portal User), however we need to be able to compare this number to the maximum number of licenses available.

 

Is there any way to query/access this maximum number from apex code? As the number could potentially change if we buy more licenses so we don't want to hardcode it. If it's not possible to get this number in apex code, is there any way to access it using the API?

 

Thanks,


Dan

Message Edited by danwilkie on 06-26-2009 07:57 AM
fgwarb_devfgwarb_dev

Did you find a solution for this?