Master the concepts of Salesforce in just 45 days Click here to know more.
8
10
58
27
Premium Salesforce Weekend Batch Start From Tomorrow.
Triggers can be used to prevent DML operations from occuring by calling the addError() method on a record or field. When used on trigger.new records in insert & update triggers and on Trigger.old records in delete triggers,the custom error message is displayed in the application interface & logged to.
Example:
Trigger AccountDeletion on Account (before delete) {
for (Account a: [SELECT id FROM Account where id in (SELECT AccountId from opportunities) AND id in :Trigger.old]) {
Trigger.oldMap.get(a.id).addError(‘Cannot delete account with related opportunities.’);
}
Note: If a trigger even throws an unhandled exception, all records are marked with an error & no further processing takes place.
< < Previous
Next > >
The batch is going to start shortly. Fill the form given below to Register yourself now.
Fill out the form and get consulted by our Salesforce experts.
Fill out the form to figure out to detemine the perfect Salesforce profile for yourself.
Fill the form below to get a demo of this course.
Fill out the form to get your Premium Salesforce Development Course
Online Salesforce Development Course is soon going to be launched. Please fill the form and we will notify you about the course.