Org:Mindful Goat Playground
After completing this unit, you'll be able to:
An Apex trigger runs before or after records are inserted, updated, deleted, or undeleted. Context variables like Trigger.new and Trigger.isInsert tell the code what happened.
AccountAddressTrigger on Account, before insert and before update.Match_Billing_Address__c is true, copy the billing postal code to the shipping postal code.trigger AccountAddressTrigger on Account (before insert, before update) {
for (Account a : Trigger.new) {
if (a.Match_Billing_Address__c) a.ShippingPostalCode = a.BillingPostalCode;
}
}