Skip to content

Instantly share code, notes, and snippets.

@forcethesales
Created April 2, 2018 02:46
Show Gist options
  • Save forcethesales/28672a309639c6dbbf73ebec98d847cc to your computer and use it in GitHub Desktop.
Save forcethesales/28672a309639c6dbbf73ebec98d847cc to your computer and use it in GitHub Desktop.
trigger AccountAddressTrigger on Account (before insert, before update) {
// Get the List of accounts
//List<Account> newAccts = new List<Account>(
//[SELECT Id,Match_Billing_Address__c,BillingPostalCode,ShippingPostalCode FROM Account WHERE Id IN :newAccts]);
for(Account alice : Trigger.New) {
if (alice.Match_Billing_Address__c == true) {
alice.ShippingPostalCode = alice.BillingPostalCode;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment