• sneha wali
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
I want to delete the record after inserting. Can anyone help to solve this?

trigger LeadUpdateTrigger on Lead (after insert) {
   List<String> ld = new List<String>();
   List<Lead> oldld = new List<Lead>();
   
   for(Lead l : Trigger.new){
       ld.add(l.Phone);
       ld.add(l.Email);
   }
   
   List<Lead> lds = [SELECT Email,LeadSource,Phone FROM Lead where Phone in :ld AND Email in : ld];
  
   if(lds.size()>0){
       for(Lead l1 : lds){
           for(Lead l2 : Trigger.New){
               l1.LeadSource = l2.LeadSource;
               oldld.add(l1);   
           }
       }
       update oldld;
   } 
}

I want to delete "l2" which is new record after oldld is updated
we have lead record with name,phone num,email id and lead source. now if we create one more lead record with same name, phone num, email id but with different lead source, how to update the old lead source value with new lead source value using trigger retaining all the other information?
 we create a custom field "follow up date" with date/time data type and we want write workflow  to send an email whenever the "follow up date" matches with "now()". How to solve this? 
how to check whether the last modified date is changed using workflow?
Question was if the salesperson does not edit the lead , his head should recieve a notification mail. and if head also does not respond to it, his head should get a mail after 24 hours. can anyone help to solve this?
I want to delete the record after inserting. Can anyone help to solve this?

trigger LeadUpdateTrigger on Lead (after insert) {
   List<String> ld = new List<String>();
   List<Lead> oldld = new List<Lead>();
   
   for(Lead l : Trigger.new){
       ld.add(l.Phone);
       ld.add(l.Email);
   }
   
   List<Lead> lds = [SELECT Email,LeadSource,Phone FROM Lead where Phone in :ld AND Email in : ld];
  
   if(lds.size()>0){
       for(Lead l1 : lds){
           for(Lead l2 : Trigger.New){
               l1.LeadSource = l2.LeadSource;
               oldld.add(l1);   
           }
       }
       update oldld;
   } 
}

I want to delete "l2" which is new record after oldld is updated
we have lead record with name,phone num,email id and lead source. now if we create one more lead record with same name, phone num, email id but with different lead source, how to update the old lead source value with new lead source value using trigger retaining all the other information?
how to check whether the last modified date is changed using workflow?
Question was if the salesperson does not edit the lead , his head should recieve a notification mail. and if head also does not respond to it, his head should get a mail after 24 hours. can anyone help to solve this?