![](https://trailblazers.salesforce.com/img/userprofile/default_profile_200_v2.png)
trigger AccountAddressTrigger on Account (before insert, before update) {
For (Account a : Trigger.new) {
If (a.Match_Billing_Address__c=true) {
system.debug(a.Match_Billing_Address__c);
a.ShippingPostalCode=a.BillingPostalCode;
}
}
}
1 件の回答
It should have been:
if(a.Match_Billing_Addtess__c == true)
What you were doing - and this will explain the "stranger problem" - was setting that checkbox to true ("=" assigns a value, "==" evaluates equality) which then caused the IF statement to evaluate to TRUE.