Skip to main content

When using Work.com/Employee Concierge, in setup we have tried to turn on "Auto-create users" in setup under "Employee-User Settings". This enables a package trigger that should create a new user when a new employee record is created. When this is turned on, we get this error when saving a new employee record:

 

  • DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): PermissionSetAssignment, original object: Account

This error only occurs when the Concierge EmployeeTrigger (which creates new PersonAccount when Employee record is created) is also turned on. This appears to be a conflict resulting from both triggers trying to insert a User record and PersonAccount record in the same DML transaction. Since both these triggers are managed, we can't fix this.

 

I suppose the workaround is to turn off one or the other of these tirggers, and then manually run it's associated batch job after creating new Employees. But wanted to check to see if we are missing something. Thanks.

4 respuestas
  1. 27 jul 2022, 3:45

    @Gloria Gutierrez Thanks for the response. I'm not seeing that permission in this org (where is it located?).

     

    We ended up turning off the "Auto-create users" trigger and writing our own custom trigger.

0/9000