When attempting to add all users to a permission set programmatically using the Java SOAP API, I am running into an issue where all of the users are not being added to the permission set. The error message I am getting is:

Can't complete this operation because it would exceed the number of apps allowed by the user license.

And the error code is TABSET_LIMIT_EXCEEDED. I am not sure why the number of apps would cause this issue. When I try adding the users manually, the users are added. It is only when attempting to programmatically add them.

Some details about this permission set is that the only thing it does it only allows Visualforce Page Access to a few of my Visualforce Pages, nothing else. There is nothing related to Work.com or other Assigned Apps relating to this permission set.

Relevant code looks like the following:

String permissionSetId = "MyPermissionSet";
SObject[] userSObjects = getAllUsers();
List<SObject> newSObjects = new ArrayList<>();
for (SObject sObject : userSObjects) {
    SObject newSObject = new SObject();
    newSObject.setSObjectField("AssigneeId", sObject.getId());
    newSObject.setSObjectField("PermissionSetId", permissionSetId);

SObject[] newSObjectsArray = newSObjects.toArray(new SObject[0]);
SaveResult[] saveResults = create(newSObjectsArray);

I've also set the allOrNone header and that has not effect on the results, still giving me this error. For reference, I am trying to add upwards to 200 or more users. Even trying around 2 users does not work programmatically.

  • did you try this ? help.salesforce.com/… – sdandamud1 Jul 8 '19 at 17:03
  • @sdandamud1 I don't think this applies, I don't see Work.com in my permission set. Let me add a description about this particular permission set in the post. Sorry about that! – David Jul 8 '19 at 18:05
  • May be u r trying to update user where any featured license like service cloud user checkbox is added and now it's throwing error – Ayub Jul 8 '19 at 18:54

I've found a work around for this issue using the REST api instead of the Java SOAP api. For some reason, the REST api doesn't run into this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.