Salesforce Certified Platform Developer II — Question 165

A company uses Opportunities to track sales to their customers and their org has millions of Opportunities. They want to begin to track revenue over time through a related Revenue object.

As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic.

They estimate that roughly 100,000 Opportunities will have Revenue records created and populated.

What is the optimal way to automate this?

Answer options

Correct answer: D

Explanation

The correct answer is D because using Database.executeBatch() allows for processing large sets of records in manageable chunks, which is ideal for handling the creation of Revenue records for the estimated 100,000 Opportunities. Options A and B incorrectly reference Queueable classes, which are not suited for bulk processing as effectively as Batchable classes. Option C involves scheduling jobs, which is unnecessary for a one-time data seeding task.