Salesforce Certified Platform Developer II — Question 207

As part of a new integration, a developer is asked to implement a new custom search functionality that is capable of performing unrestricted queries and can account for all values within a custom picklist field, Type__c, on the Opportunity object. The search feature must also account for NULL values.

The organization-wide default for the Opportunity object is set to Public Read-Only, and a new custom index has been created for the Type__c field. There are more than 5 million Opportunity records within the environment, and a considerable amount of the existing records have NULL values for the picklist.

Which technique should the developer implement to maximize performance when querying NULL values?

Answer options

Correct answer: D

Explanation

The correct answer is D because creating a formula field that substitutes NULL values allows for better indexing and querying performance. Options A and B do not optimize for NULL values effectively, while C introduces unnecessary complexity by executing multiple queries and relying on Apex for merging results.