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

Auto deleting case salesforce

i have some cases which gets created via email to case but i dont need dose cases so i want to delete them right away

i need this use case of its.
for client need.

can anyone help for this reqiurement?
Raj VakatiRaj Vakati
You can create a trigger .. 

try this code
trigger CaseTrigger on Case (after insert , after update){
   if(Trigger.isInsert || Trigger.isUpdate){
    List<Case> casetoDelet = new List<Case>();
    for(Case c{
     if(c.Origin == 'Email'){
      delete casetoDelet;