function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak Techmodel5Deepak Techmodel5 

Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field?

User-added image HI Folks!! Whether i need to create Custom fiels for account like Match_Billing_Address with API NAME: 'Match_Billing_Address__c
Lokesh KumarLokesh Kumar
Hi Deepak,

No, you can just check like below : 
 
if(acc.ShippingPostalCode != acc.BillingPostalCode){
acc.shippingPostalCode = acc.BillingPostalCode;
}
-Lokesh 
Deepak Techmodel5Deepak Techmodel5
User-added image  

Still getting an error while checking challenge! "A field with an API Name 'Match_Billing_Address__c' does not exist on the Account object"?
Deepak Techmodel5Deepak Techmodel5
Hi lokesh,

               Solved by creating custom field with API Match_Billing_Address__c. And Changed data type from Text to Checkbox and checked. It's workout. Thank you for your help.