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

Trailhead Trigger chalange
Hi Expert,
I am doing Trailhead Trigger chalange :-

and i have create a trigger:-
trigger AccountAddressTrigger on Account (before update) {
for(Account a : Trigger.New){
System.assertEquals(TRUE, a.Test_LightingCo__Match_Billing_Address__c);
a.Test_LightingCo__ShippingPostalCode__c = a.Test_LightingCo__BillingPostalCode__c ;
}
}
that is updating the shipping postal code field fine but when i click on "CHECK CHALANGE" button then got a error that is above of the image in RED.
Please suggest what i miss.
Thanks
Mukesh
I am doing Trailhead Trigger chalange :-
and i have create a trigger:-
trigger AccountAddressTrigger on Account (before update) {
for(Account a : Trigger.New){
System.assertEquals(TRUE, a.Test_LightingCo__Match_Billing_Address__c);
a.Test_LightingCo__ShippingPostalCode__c = a.Test_LightingCo__BillingPostalCode__c ;
}
}
that is updating the shipping postal code field fine but when i click on "CHECK CHALANGE" button then got a error that is above of the image in RED.
Please suggest what i miss.
Thanks
Mukesh
try this below code
Thanks
Mark it best answer if it helps you
All Answers
Try below code
try this below code
Thanks
Mark it best answer if it helps you
1) https://developer.salesforce.com/forums/?id=906F0000000AuHoIAK
2) https://developer.salesforce.com/forums/?id=906F0000000ArVxIAK
I found below issue in your code.
1) Trigger shoud be on before insert and before update event
2) You need to check Match_Billing_Address__c should be true and BillingPostalCode should not null.
Let us know if this will help you