There are lots of different User Licenses in Salesforce.

I need to know which ones are valid for Public Groups, since otherwise, the trigger that adds a user to a public group upon creation will throw this exception.

So I need to limit the public group assignment to just the valid types.

Obviously the "Salesforce Platform" (License Key AUL) and "Salesforce" (License Key SFDC) are valid, but are any of the others? Right now we're not using any other license type, but could do in the future.

  • 1
    Not a direct answer to your question, but have you considered just adding a try/catch that skips the add when an exception is thrown? That way you don't always have to know 100% of the valid types in the future when Salesforce changes/adds licenses or rules around public groups.
    – jkraybill
    Aug 15, 2014 at 5:27
  • 1
    Unfortunately I think that's probably the best thing to do, would have to be a Database.insert with partial success since it's designed for bulk insert. Not ideal.
    – George S.
    Aug 15, 2014 at 13:53


You must log in to answer this question.

Browse other questions tagged .