Salesforce Trailhead - Get Started with Apex Triggers Challenge

preview_player
Показать описание
#1 Salesforce Training Tutorials

Promote Your Salesforce App on This Channel:

FULL PLAYLIST:

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

For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).

The Apex trigger must be called 'AccountAddressTrigger'.

The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.

With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.
Рекомендации по теме
Комментарии
Автор

this is the best tutorial I have ever watched.

heyimhoben
Автор

Thank you for this, I have been having trouble doing the challenges just from the examples in the units.

gilberttheconsumerofrealit
Автор

thank you this really helps with understanding Triggers.

keerthierpula
Автор

Crystal clear explanation of each and every line of code. Thank You!!.

maddipatirenu
Автор

Great job🥳im confusing what i do after Checking Match_Billing_Address 🤣🤣🤣🤣🤦‍♂️🤦‍♂️but now i fully understood we need to copy the billing add. To shipping
That's solve🥳😂😂😂

YourDecentFather
Автор

hi sir, i've got an issue with this challenge, Everything works fine when the match billing Address check box is (checked or not) except for the fact that when I check the challenge, it doesn't validate and it sends out a message saying '"We updated an account that had 'Match_Billing_Address__c' set to false. We expected the Apex trigger not to fire, but it did. Make sure the Apex trigger fires only if 'Match_Billing_Address__c' is true.""

I really don't understand why. I need help. thanks

toko
Автор

Hey, thanks for this video.
Question, how do I get the intellisense to show for me?

techsalesforce
Автор

trigger AccountAddressTrigger on Account (before insert, before update) {

for(Account a:Trigger.New){


}
}
}

ITBHarshitha
Автор

Wow - thank you this really helps with understanding Triggers.

lizwhiting
Автор

Hi, Im very satisfied with your explanation, if you don't mine will you please do a video on "Security Specialist" for super badge

babarhussain
Автор

Sir please help me how to deactivate the apex trigger in true production org

muraligupta
Автор

Setting 'Match_Billing_Address__c' to false updated the records anyway. The trigger should only act when Match_Billing_Address__c is true. i am getting this error

phanindrasai
Автор

We updated an account that had 'Match_Billing_Address__c' set to true. We expected the trigger to fire, but it didn’t. Make sure the trigger fires if 'Match_Billing_Address__c' is true.

I am Getting error Like this, I have done everything many times, still I am not getting where the error is ? kindly please help me.

kadapacharan
Автор

Thanks for the solution.
However this can be resolved by just making the shipping postal code= billing postal code when the Match billing address is checked/True.
Setting up the value for rest of the field if good practically however not required for this challenge.

reloadedseban