We have a business scenario where an incoming EmailMessage sent to a closed Case, should be automatically reparented to another case that's Opened.

The logic would achieve this by modifying the ParentId field in the EmailMessage instance.

The logic was in place since January 18'. Suddenly, since this morning we're getting errors like this one:

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : EmailMessageTrigger: execution of AfterInsert
caused by: System.SObjectException: Field is not writeable: EmailMessage.ParentId

In the Workbench this field, does appear to have the updateable attribute set to false.

Has this behaviour changed "overnight" from Salesforce and we suddenly cannot reparent the EmailMessage instances in Salesforce?

  • v46 doc says ParentId is not updateable. did a version change for you in the apex class that did the reparenting?
    – cropredy
    Aug 14 '19 at 19:47
  • The class where the error happens is V45.0. Whereas the Org API version is V46.0(obviously I guess, as this corresponds with the summer release 19'). Aug 15 '19 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.