1

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

0

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)

You must log in to answer this question.

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