Salesforce DML Exception while Emailing and Updating User

--

The following exception is thrown when sending emails and updating the users using apex with setSaveAsActivity set as true while sending emails.

Sample Code to reproduce the issue:

Use setSaveAsActivity( false ) to resolve the issue.

Sample Code to fix the issue:

--

--

Alok Gupta

Tech enthusiastic, life explorer, single, motivator, blogger, writer, software engineer