You need to sign in to do that
Don't have an account?
Vikram Singh 157
Error in Triggers as given below for this requirement :--"Delete all the contact with the same name as of account name that we are inserting"
trigger Conrecords on Account (before insert)
{
List<String> name1 = new List<String>();
for(Account a : trigger.new)
{
myname.add(a.name);
}
List<contact> contact1=[select id,name from contact where name in : name1];
delete contact1;
}
{
List<String> name1 = new List<String>();
for(Account a : trigger.new)
{
myname.add(a.name);
}
List<contact> contact1=[select id,name from contact where name in : name1];
delete contact1;
}
try this,
select as best answer if it works
thanks
All Answers
try above code.
try this,
select as best answer if it works
thanks