Salesforce Certified Platform Developer II — Question 176
A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours.
Which two steps should a developer take to accomplish this? (Choose two.)
Answer options
- A. Use the @future annotation on the method that performs the aggregate calculation.
- B. Implement the Schedulable interface in the class that contains the aggregate calculation method.
- C. Use the @readOnly annotation on the method that performs the aggregate calculation.
- D. Implement the Queuable interface in the class that contains the aggregate calculation method.
Correct answer: B, D
Explanation
The correct answers are B and D. Implementing the Schedulable interface (B) allows the calculation to be executed on a daily schedule, while the Queuable interface (D) enables processing large data volumes asynchronously. Options A and C are incorrect because @future and @readOnly are not suitable for scheduling tasks or handling large data aggregations effectively in this context.