You need to sign in to do that
Don't have an account?
System 181
Lead deletion trigger
Hi all,
I am very new to creating triggers, I have the trigger below that I want to add the lead status to (id lead status is "in progree") do not allow users to delete, here is the trigger:
1
2
3
4
5
6
7
8
trigger deletion on lead
(before delete){
for(lead lead: Trigger.old){
if(lead.Ninja_Store_Id__c!=null){
lead.AddError('You can’t delete this lead in SF, You can only abandon it');
}
}
}
Any help is so much appreciated
Thanks,
I am very new to creating triggers, I have the trigger below that I want to add the lead status to (id lead status is "in progree") do not allow users to delete, here is the trigger:
1
2
3
4
5
6
7
8
trigger deletion on lead
(before delete){
for(lead lead: Trigger.old){
if(lead.Ninja_Store_Id__c!=null){
lead.AddError('You can’t delete this lead in SF, You can only abandon it');
}
}
}
Any help is so much appreciated
Thanks,
Please follow below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Try Below trigger Please Mark It As Best Answer If It Helps Thank You!
I have already shared my code according your requirment in first look:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh