trigger checkUpdate on Opportunity(after insert, afetr update) { for(Opportunity opp : trigger.new){ //Get Old Values Opportunity oldOpp = trigger.oldMap.get(opp.id);
//Check if value is updated if(oldOpp.FieldYouWantToCheck__c != opp.FieldYouWantToCheck__c) { //Do anything which you want to do if field is updated } } }
You can do this with the help of below code:
trigger checkUpdate on Opportunity(after insert, afetr update) {
for(Opportunity opp : trigger.new){
//Get Old Values
Opportunity oldOpp = trigger.oldMap.get(opp.id);
//Check if value is updated
if(oldOpp.FieldYouWantToCheck__c != opp.FieldYouWantToCheck__c) {
//Do anything which you want to do if field is updated
}
}
}
Thanks,
Abhishek.
Following is the code: