function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Can code using the EmailMessage object not be transported using change sets or Migration tool?


When creating a simple class (or trigger) CheckEmail using the EmailMessage object with the method

public class CheckEmail {
   public static void HandleEmailMessages(List<EmailMessage> emailMessageList){

this class works fine functionally, however can not be moved using the Migration tool or Change sets to my next sandbox.

The error received is:

Apex Class

Entity is not org-accessible
Does anybody have any clue why this class does not transport?


Figured out that the target environment first needs to have email2case enabled in configuration. When this is enabled, the EmailMessage object becomes available for usage. 

Charlotte GibsonCharlotte Gibson
Thanks so much for taking the time to come back and post your solution Guy - you saved me a couple of hours work this weekend!