Skip to main content
Hi,

I have a use case where I am creating a case using Email-to-Case. I need to edit the case description (which is the body of the email) using apex but I'm getting the following error

System.DmlException: Update failed. First exception on row 0 with id 02sHr00001an6LHIAY; first error: INVALID_OPERATION, operation is not allowed: [].

Is it possible to edit an EmailMessage in this case? Please suggest the steps to do so
3 respostas
  1. 30 de mai. de 2023, 17:29
    Hello Abhishek ,

    EmailMessage can be updated only when it's in the Draft status.

    Update() is supported when an email record is in Draft status, and IsPrivateDraft is false. It is also supported if Status and IsPrivateDraft are true and CreatedBy is associated with the current user. When the email record status is not in Draft status, the IsExternallyVisible field and custom fields only can be updated.

    Reference -> https://salesforce.stackexchange.com/questions/312390/receiving-illegal-operation-error-on-emailmessage-update-from-contentdocumentlin

    Hope this helps !

    Thank you.
0/9000