- Ranchi, Jharkhand, India
- hr@nubetree.com
This variable returns a list of the old version of sObject records. This list is only available in update and delete triggers
trigger ApexTrigger on Opportunity(before update) {
// Only available in Update and Delete Triggers
for (Opportunity oldOpp: Trigger.old) {
for (Opportunity newOpp: Trigger.new) {
if (oldOpp.Id == newOpp.Id && oldOpp.Amount != newOpp.Amount)
newOpp.Amount.addError('Amount cannot be changed');
// Trigger Exception
}
}
}
We design tailored systems that grow with your business, ensuring flexibility, efficiency, and long-term success.
Our company has a team of certified experts with years of experience and a strong passion for technology.
Stay connected for the latest updates, tips, and exclusive content!
Copyright 2024. All rights reseved by NubeTree.com