You need to sign in to do that
Don't have an account?
Mona Kawale
I need trigger for below scenario
//when ever new record create into account object before this new record
//is inserted into account delete all contact record with this account name
//is inserted into account delete all contact record with this account name
Can you explain more about your requirement??
Thanks!!
trigger AccountContactTrigger on Account (before insert,after update) {
List <String> myName = new List<String> ();
for(Account acc:Trigger.New){
myName.add(acc.name);
}
List <Contact> myContact= [Select id,name from Contact where name IN:myName]; delete myContact;
delete myContact;
}
Please Mark as Best Answer...If it was Helpful for you.
Thanks&Regards,
Syed Jabeena