Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 217


Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERP_Number_c, that is then used in a query to find matching Accounts.

A developer receives the exception 'SOQL query not selective enough'.

Which step should be taken to resolve the issue?

Show Answer
Correct Answer: AC

To resolve the 'SOQL query not selective enough' exception, marking the `ERP_Number_c` field as an external ID is the most suitable solution. An external ID index makes the query more selective and efficient since Salesforce will automatically index the field. This indexing reduces the complexity and improves performance of the SOQL query, helping to avoid the exception.

Discussion

6 comments
Sign in to comment
AppleDashOption: A
Feb 26, 2023

Should be A, ERP number should be set as an External ID.

Udayudyvk1818Option: A
Aug 2, 2023

A https://help.salesforce.com/s/articleView?id=000386864&type=1

stan_maltaOption: A
Nov 12, 2023

Other options won't index the field

FriedConsole2000Option: B
Feb 23, 2024

It is actually "B". https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_VLSQ.htm

Yas010101Option: C
Jan 11, 2024

Move the SOQL query to within an asynchronous process

dasabhisek404Option: A
Jul 7, 2024

Option A is correct. https://help.salesforce.com/s/articleView?id=000384950&type=1 https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_VLSQ.htm