+ 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 :trigger.new){
     if(c.Origin == 'Email'){
      delete casetoDelet;