You need to sign in to do that
Don't have an account?
sandeep kumar 44
alert massage before deleting record in trigger
hello all
i am working on a trigger in which i need to show an alret massege before deleting the record . how can i do it
{
sale__c salesobj1=new sale__c();
try
{
salesobj1=[select id from sale__c where Opportunity_Name__c=:a.id];
delete salesobj1;
}
catch(exception e)
{}
}
}
}
before salesobj1 gets deleted in need to show the alert massege to user and then let him save
i am working on a trigger in which i need to show an alret massege before deleting the record . how can i do it
{
sale__c salesobj1=new sale__c();
try
{
salesobj1=[select id from sale__c where Opportunity_Name__c=:a.id];
delete salesobj1;
}
catch(exception e)
{}
}
}
}
before salesobj1 gets deleted in need to show the alert massege to user and then let him save
From trigger you can stop the deletion altogether based on your requirement. But you cannot provide the functionality of showing an alert message and then on click of okay carry out the delete operation.
If the user is trying to delete a record from the salesforce UI then generally an alert message(technically it is not an alert but a confirm message) is shown by Salesforce by defult.
Like this -
Thanks,
Kaustav