I have created an Apex trigger, and I was trying to run a trailhead but it always throws an error:
"Challenge not yet complete... here's what's wrong: Executing the trigger did not work as expected. "
Herewith I have attached my code:
trigger AccountAddressTrigger on Account (before insert,before update) {
for(Account a : [SELECT Id FROM Account WHERE Match_Billing_Address__c = TRUE AND BillingPostalCode != NULL])
{
a.ShippingPostalCode = a.BillingPostalCode;
update a;
}//end for
}
Can anyone help me with this?