Last active
November 21, 2018 06:38
-
-
Save ganmahmud/555b84785cfdd656ea0fb3ef626688b1 to your computer and use it in GitHub Desktop.
Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger AccountAddressTrigger on Account (before insert, before update) { | |
| for(Account a : Trigger.new){ | |
| If (a.Match_Billing_Address__c == true && a.BillingPostalCode!=Null) { | |
| a.ShippingPostalCode = a.BillingPostalCode; | |
| System.debug('ShippingPostalCode: '+a.ShippingPostalCode); | |
| System.debug('BillingPostalCode: '+a.BillingPostalCode); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment