You need to sign in to do that
Don't have an account?
Vikram Singh 157
Hi ! My requirement is :- Prevent user to delete any account with opportunity
trigger preventDelete on account(before delete){
For(account a : trigger.old){
If(a.Opportunities != Null)
a.addError('You cannot delete this');
}
}
But it will also not allowing to delete account with no opportunity.
For(account a : trigger.old){
If(a.Opportunities != Null)
a.addError('You cannot delete this');
}
}
But it will also not allowing to delete account with no opportunity.
All Answers
try this
try this
devanshu sood for your help .