Back to Browse

Apex & .NET Basics|| Map .NET Concepts to the Lightning Platform||Understand Execution Context

7.6K views
May 1, 2023
14:53

#trailhead #HandonChallenge Link: https://trailhead.salesforce.com/content/learn/modules/apex_basics_dotnet?trailmix_creator_id=tristinvdb&trailmix_slug=schwab-salesforce-devloper Challenge 1: Map .NET Concepts to the Lightning Platform Summary: Create an Apex class that returns accounts Create an Apex class that returns a List of Account objects for a user-specified state. Create an Apex class that contains a static method: Name: AccountUtils Method name: accountsByState The method must return the ID and name of all Account objects that match the BillingState for the state abbreviation passed to the method Challenge 2: Understand Execution Context Summary: Write an Apex trigger that fires before records are inserted and ensures that the ShippingState field has the same value as the BillingState field. Create an Apex class that contains a public static method: Name: AccountTriggerHandler Method name: CreateAccounts The method must accept a List of Account objects For each Account record, before saving, ensure that the ShippingState field has the same value as the BillingState field Create an Apex Trigger: Name: AccountTrigger sObject: Account Fires: before records are inserted Your trigger must call the AccountTriggerHandler.CreateAccounts() method with the collection of new records Use the isBefore and isInsert trigger context variables Create a test class: Name: AccountTriggerTest Your test class must insert 200 Account records with a BillingState of CA After the insert, test to ensure that all 200 records have a ShippingState of CA Before verifying this challenge, run your test class at least once using the Developer Console Run All feature

Download

0 formats

No download links available.

Apex & .NET Basics|| Map .NET Concepts to the Lightning Platform||Understand Execution Context | NatokHD