2

I'm attempting to assign a permission set to the automated process user but I'm getting the following error:

System.DmlException: Insert failed. First exception on row 0; first error: TABSET_LIMIT_EXCEEDED, Can't complete this operation because you reached the limit of 0 of standard apps for Automated Process for the Automated Process user license. : []

There's a help article, but we don't have a knowledge tab so this doesn't help.

I've made my permission set is completely empty to eliminate variables.

Permission Set metadata

<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <description>My description</description>
    <hasActivationRequired>false</hasActivationRequired>
    <label>My test permission set</label>
</PermissionSet>

There's a similar question, however the answer there was to use PlatformEventSubscriberConfig instead, which doesn't actually solve this problem.

My code that applies the permission set. I'm running this from the execute anonymous window as system admin, and from a button in a VF page as system admin.

User automatedProcessUser = [SELECT Id FROM User WHERE alias = 'autoproc'];
PermissionSet automatedProcessPermissionSet = [SELECT Id FROM PermissionSet WHERE Name = 'my_permission_set_name'];

List<PermissionSetAssignment> permissionSets = [
    SELECT Id
    FROM PermissionSetAssignment
    WHERE AssigneeId = :automatedProcessUser.Id
    AND PermissionSetId = :automatedProcessPermissionSet.Id
];

if(permissionSets.size() == 0) {
    insert new PermissionSetAssignment (
        AssigneeId      = automatedProcessUser.Id,
        PermissionSetId = automatedProcessPermissionSet.Id
    );
}

1 Answer 1

2

You might try this (URL hacking)

https://mydomain/lightning/setup/PermSets/page?address=%2Fudd%2FPermissionSet%2FassignPermissionSet.apexp%3FuserId%3D00536000000rMUGAA2

where

00536000000rMUGAA2

happens to be the Automated Process User in my org

Now

  1. When I do this, the UX comes back with an Insufficient Privileges error but ...
  2. The Permission Set Assignment sticks (you can login.logout and repeat to prove or do a SOQL query on PermissionSetAssignment as per below)
SELECT id, Assignee.name, Permissionset.Name 
FROM PermissionSetAssignment where AssigneeId = '00536000000rMUGAA2'

I'd also make sure the Permission Set doesn't have a required Permission Set License (blank)

UPDATE (2024-06)

  • With a PS containing assigned recordtypes, I tried this and while the URL hack does bring up the proper dialog, assigning the Permission Set to the Automated Process User results in the error noted by the OP
  • Deleting the Knowledge tab and repeating the assignment did in fact assign the PS to Automated Process User and you can see the assignment in the UX.
  • Adding the Knowledge tab back did not affect the assignment
  • However, the assigned record types in the PS have no effect at runtime, the Automated Process user can't create objects with the record types
1
  • 1
    Inserting new PermissionSetAssignment with autoproc user - URL hacking did not work (yields a meaningless error) but deleting Knowledge tab did the trick. The tabset error went away, permset assignment worked. No recordtypes in our case, however.
    – identigral
    Commented Dec 6 at 1:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .