You need to sign in to do that
Don't have an account?

Trigger.new on Account Object returning old values for BillingCountry field (before update event)
I am surprised to see this behaviour .I am updating billingCountry and billingpostalcode of Account.In trigger.new i am recieving billingpostalcode new value but not same case with billingcountry.
codesnippet:
trigger AccountTrigger on Account (before insert ,before update,after insert,after update) {
if(trigger.isBefore){
for(account accnt:trigger.new){
system.debug('testing'+accnt.BillingCountry+accnt.BillingPostalCode);
}
}
}
am i only the one who is facing this?
codesnippet:
trigger AccountTrigger on Account (before insert ,before update,after insert,after update) {
if(trigger.isBefore){
for(account accnt:trigger.new){
system.debug('testing'+accnt.BillingCountry+accnt.BillingPostalCode);
}
}
}
am i only the one who is facing this?
All Answers
Trigger.new : Returns a list of the new versions of the sObject records. Note that this sObject list is only available in insert and update triggers, and the records can only be modified in before triggers.
Trigger.old : Returns a list of the old versions of the sObject records. Note that this sObject list is only available in update and delete triggers.
Here, you are getting new values, not old values. old value means existing data from database.