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
subbu.flex9@gmail.comsubbu.flex9@gmail.com 

Delete through trigger

can delete records in trigger by using delete statements ?

 

if possible what are the possible trigger events ?

 

if not possible , what is the reason behind that ?   ple tell me this is one of the interview question to me .   

 

 

thank u

testrest97testrest97

We cannot delete beacuse we are still updating the records, the context is not yet completed. We can however delete by creating a new instance of the record using new key word.

 

Eg: case c=new case(id=c.id);