Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create an Apex class that uses the @future annotation to update Account records. Create an Apex class with a future method that accepts a List
Create an Apex class that uses the @future annotation to update Account records. Create an Apex class with a future method that accepts a List of Account IDs and updates a custom field on the Account object with the number of contacts associated to the Account. Write unit tests that achieve code coverage for the class. Every handson challenge in this module asks you to create a test class. Create a field on the Account object: Label: Number Of Contacts Name: NumberOfContacts Type: Number This field will hold the total number of Contacts for the Account Create an Apex class: Name: AccountProcessor Method name: countContacts The method must accept a List of Account IDs The method must use the @future annotation The method counts the number of Contact records associated to each Account ID passed to the method and updates the 'NumberOfContactsc field with this value Create an Apex test class: Name: AccountProcessorTest The unit tests must cover all lines of code included in the AccountProcessor class, resulting in code coverage. Before verifying this challenge, run your test class at least once using the Developer Console Run All feature
Create an Apex class that uses the @future annotation to update Account records.
Create an Apex class with a future method that accepts a List of Account IDs and updates a custom field on the Account object with the number of contacts associated to the Account. Write unit tests that achieve code coverage for the class. Every handson challenge in this module asks you to create a test class.
Create a field on the Account object:
Label: Number Of Contacts
Name: NumberOfContacts
Type: Number
This field will hold the total number of Contacts for the Account
Create an Apex class:
Name: AccountProcessor
Method name: countContacts
The method must accept a List of Account IDs
The method must use the @future annotation
The method counts the number of Contact records associated to each Account ID passed to the method and updates the 'NumberOfContactsc field with this value
Create an Apex test class:
Name: AccountProcessorTest
The unit tests must cover all lines of code included in the AccountProcessor class, resulting in code coverage.
Before verifying this challenge, run your test class at least once using the Developer Console Run All feature
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started