Salesforce Certified Platform Developer II — Question 20

A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page.
Which feature of Apex code is required to facilitate this solution?

Answer options

Correct answer: B

Explanation

The correct answer is B, describeSObjects(), because it allows the developer to retrieve metadata about the fields of an object, enabling users to select which fields to filter by. Option A, SOSL queries, is not suitable as it is used for searching across multiple objects. Option C, Dynamic Schema binding, refers to dynamically binding to fields but does not provide the necessary metadata. Option D, REST API, is unrelated to the filtering functionality needed in this scenario.