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
FastSnailFastSnail 

insert trigger - entity_is_deleted error in Production. Works fine in Sandbox

Hello;
I am facing a strange behavior of my apex code in Production, which does not occur in Sandbox. I can't pinpoint the issue.
Basically an apex class insert a record, which triggers a 'Before Insert' trigger, and then an 'After Insert' trigger.
The Before Trigger runs fine, but the After Insert trigger is never actuated, and the apex 'insert record' returns a 'Entity_is_Deleted'.
The user/profile is able to insert the record using another apex class in Production, so this is not a security/visibility/right issue.
Any idea?  Thanks in advance for getting back to me.
All the best,
Jerome
 
Raj VakatiRaj Vakati
Can you share the code ? Before that can you compile and see all the classes ??
FastSnailFastSnail
Hi Rav;
I fell that the code will not help you. Too big.One clue is that the same code runs in Production with a different user profile.
Although it says 'Entity is deleted', it is in fact never inserted. The Before Delete trigger for th record does not run. ????
Jerome