Salesforce Certified Platform Developer II — Question 163
A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as 100,000 Catalog Items.
Both custom objects have a CurrencyIsoCode Text field that contains the currency code they should use. If a Catalog’s CurrencyIsoCode changes, all of its Catalog Items’ CurrencyIsoCodes should be changed as well.
What should a developer use to update the CurrencIsoCodes on the Catalog Items when the Catalog’s CurrencyIsoCode changes?
Answer options
- A. An after insert trigger on Catalog that updates the Catalog Items if the Catalog’s CurrencyIsoCode is different.
- B. A Database.Schedulable and Database.Batchable class that queries the Catalog object and updates the Catalog Items if the Catalog CurrencyISoCode is different.
- C. An after insert trigger on Catalog Item that updates the Catalog Items if the Catalog’s CurrencyIsoCode is different.
- D. A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencyISoCode is different.
Correct answer: D
Explanation
Option D is correct because it allows for the processing of a large number of Catalog Items in batches, which is necessary given the potential volume of up to 100,000 items. The other options are not suitable as they either target the wrong object or event, and do not efficiently handle bulk updates required in this scenario.