• Alesia Dvorkina 11
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am working on a flow that would create a Contact when a new User (UserType = Standard) is created.

I am getting the following error:
An error occurred at element Create_Contact (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (MIXED_DML_OPERATION) DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User, 


I have researched and found out that this is a common error when trying to perform DML operations on non-setup (Contact) and setup (User) objects. The solution for those who encountered this error from a Trigger is to split DML operations into future and non future context (perform DML on Non-Setup object type, then perform DML on Setup object type in @future methods). 

How can I apply this logic to a Flow used in a Process? Any ideas? Thanks in advance for help!

I am working on a flow that would create a Contact when a new User (UserType = Standard) is created.

I am getting the following error:
An error occurred at element Create_Contact (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (MIXED_DML_OPERATION) DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User, 


I have researched and found out that this is a common error when trying to perform DML operations on non-setup (Contact) and setup (User) objects. The solution for those who encountered this error from a Trigger is to split DML operations into future and non future context (perform DML on Non-Setup object type, then perform DML on Setup object type in @future methods). 

How can I apply this logic to a Flow used in a Process? Any ideas? Thanks in advance for help!

I am working on a flow that would create a Contact when a new User (UserType = Standard) is created.

I am getting the following error:
An error occurred at element Create_Contact (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (MIXED_DML_OPERATION) DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User, 


I have researched and found out that this is a common error when trying to perform DML operations on non-setup (Contact) and setup (User) objects. The solution for those who encountered this error from a Trigger is to split DML operations into future and non future context (perform DML on Non-Setup object type, then perform DML on Setup object type in @future methods). 

How can I apply this logic to a Flow used in a Process? Any ideas? Thanks in advance for help!