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.
A map of IDs to the old version of the sObject records.
trigger ApexTrigger on Opportunity (before update) {
// Only available in Update and Delete Triggers
Map<Id,Opportunity> oMap = new Map<Id,Opportunity>();
oMap = trigger.oldMap;
for(Opportunity newOpp : trigger.new)
{
Opportunity oldOpp = new Opportunity();
oldOpp = oMap.get(newOpp.Id);
if(newOpp.Amount != oldOpp.Amount)
newOpp.Amount.addError(‘Amount cannot be changed’); // Trigger Exception
}
Note: This map is only available in update & delete triggers.
< < 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.