0

I have a Flow where I create a User and a resource, related to that user, the object resource is managed by Field Service Lightning Package from Salesforce.

The Flow itself seems to work fine, except the error at the end, which returns the following:

Error Occurred: This error occurred when the flow tried to create records: MIXED_DML_OPERATION: DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): CKSW_BASE__Resource__c, original object: User. For details, see API Exceptions.

Does anyone know what that means?

0

There are two types of records in salesforce, Setup and non-Setup records. A Setup record is one that normally appears in Setup, such as Group, User, Profile, and so on. Contrariwise, non-Setup records are those that users use during their daily routine, such as Accounts, Contacts, and Custom Objects. This error prevents a user from updating a Setup record and non-Setup record in the same transaction. I'm not sure if it's documented why this limitation exists, but it does. You'll need to configure your Flow to Wait until after the current transaction completes, or have the Flow call a Future method.

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.