You need to sign in to do that
Don't have an account?

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
Did you find a solution for this?