why I am getting this error.... Please let me know
trigger AccountAddressTrigger on Account (before insert, before update) { For(Account accountAddress: Trigger.new){ if(accountAddress.BillingPostalCode !=null && accountAddress.Match_Billing_Address__c ==true){ accountAddress.ShippingPostalCode=accountAddress.BillingPostalCode; } } }
What is wrong in the above error?
Also I have created Mailing Billing Address as field on Account object.
Hi Gurusha,
"Try this code."
trigger AccountAddressTrigger on Account (before insert , before update) {
for(Account a:Trigger.New){
if(a.Match_Billing_Address__c && (a.BillingPostalCode != null || a.BillingPostalCode!=' ' )){
a.ShippingPostalCode = a.BillingPostalCode;
}
}
}
If you find your Solution then mark this as the best answer.
Thank you!
Regards
Suraj Tripathi