Salesforce DML Exception while Emailing and Updating User

2K views Aug 25, 2023

The following exception is thrown when sending emails and updating the users using apex with setSaveAsActivity set as true while sending emails. Exception: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): User, original object: EmailMessage: [] Blog Post: https://www.infallibletechie.com/2023/02/salesforce-dml-exception-while-emailing-and-updating-user.html

#Internet Software
  # Reference