Salesforce Certified Platform Developer II — Question 242

A developer is writing a Lightning Web page that queries accounts in the system and presents a lightning-datatable with the results. The users want to be able to filter the results based on up to five fields, that will vary according to their selections when running the page.

Which feature of Apex code is required to facilitate this solution?

Answer options

Correct answer: B

Explanation

The correct answer is B, as describeSObjects() allows the developer to obtain metadata about the objects and fields, which is essential for creating dynamic filters based on user selections. SOSL queries (A) are used for searching text across multiple objects, Dynamic SQL (C) is not relevant for this scenario, and the REST API (D) is for external system integration rather than internal filtering logic.