You need to sign in to do that
Don't have an account?

Trailhead Trigger Issue
Hi Expert,
I am doing trailhead trigger and using code this
trigger AccountAddressTrigger on Account (before insert, before update) {
for(Account a : Trigger.new){
If (a.Test_LightingCo__Match_Billing_Address__c == true && a.Test_LightingCo__BillingPostalCode__c != Null) {
a.Test_LightingCo__ShippingPostalCode__c = a.Test_LightingCo__BillingPostalCode__c ;
}
}
}
but code is working fine and Account object records update perfect. but if i clicks on "check chellange" button on trailhead trigger page then , i got an error

Please suggest
Thanks
Mukesh
I am doing trailhead trigger and using code this
trigger AccountAddressTrigger on Account (before insert, before update) {
for(Account a : Trigger.new){
If (a.Test_LightingCo__Match_Billing_Address__c == true && a.Test_LightingCo__BillingPostalCode__c != Null) {
a.Test_LightingCo__ShippingPostalCode__c = a.Test_LightingCo__BillingPostalCode__c ;
}
}
}
but code is working fine and Account object records update perfect. but if i clicks on "check chellange" button on trailhead trigger page then , i got an error
Please suggest
Thanks
Mukesh
create new custom field with name
Match_Billing_Address__c and type is checkbox on account object and try below trigger code
Thanks
Mark it best answer if my answer helps you :)
Trigger functionality is working fine and i have already created "Match_Billing_Address__c" checbox.
But issue is raised on check chellange button.
Please suggest