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
Yuvraj ProgrammerYuvraj Programmer 

Unable to completed Trailhead task

I have created the account trigger to complete the trailhead task. But I'm facing following error:
Error:
Challenge Not yet complete... here's what's wrong: 
Setting 'Match_Billing_Address__c' to false updated the records anyway. The trigger should only act when Match_Billing_Address__c is true.


Trigger code:
trigger AccountAddressTrigger on Account (before insert, before update) {

    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c == true) {
            a.ShippingPostalCode = a.BillingPostalCode;
        }   
    }

}

Anyone please guide me which part I missed? Thanks in advance.
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Yuvraj,

May I suggest you please refer the below link to reference. hope it helps.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar
Yuvraj ProgrammerYuvraj Programmer
Hi Rahul,

Thanks for your reply. I visited the pages which you shared a link with me. Still I'm not able to pass the trailhead. 
NagendraNagendra (Salesforce Developers) 
Hi Yuvraj,

Please check with below link from the forums community which might help you with the above requirement. Please let us know if this helps.

Thanks,
Nagendra
Yuvraj ProgrammerYuvraj Programmer
Hi Nagendra,

The link which you shared with me, already sent by Rahul Kumar.  Still I'm not able to pass the trailhead.

Thanks.