You need to sign in to do that
Don't have an account?

Before Delete addError() message not user friendy
I have a before delete trigger on Topic Assignment that I'm using to block a User from deleting a Topic from a Question in a lightning community. The trigger works fine and blocks the DML, however the error message is not User friendly and I cannot figure out how to get it to display ONLY my error message.
What's odd is that it seems to work for Trigger.new. Help is appreciated.
trigger TopicAssignmentTrigger on TopicAssignment (before delete) {

What's odd is that it seems to work for Trigger.new. Help is appreciated.
trigger TopicAssignmentTrigger on TopicAssignment (before delete) {
for(TopicAssignment ta : Trigger.old){
//Conditional logic will go here
ta.addError('CANNOT DELETE THIS TOPIC'); }
}ta.addError('CANNOT DELETE THIS TOPIC'); }
HI Melinda,
Using stadard page we can have these kind of messages only when we save info , but we cannot have this for delete actions as the page will be redirected to some predefined page. The only way is to customize the detail page usign visual force and there we can have own custom validation.
Regards,
Avishek Nanda