PDII Exam Question 31

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.
Java
erpNumber = erpNumber + '%';
List<Account> accounts = [SELECT Id, Name FROM Account WHERE ERP_Number__c LIKE :
erpNumber];
A developer receives the exception 'SOQL query not selective enough'. Which step should be taken to resolve the issue?
  • PDII Exam Question 32

    An Apex trigger creates a Contract record every time an Opportunity is marked as Closed/Won. Historical records need to be loaded, but Contract records should not be created during this mass load. What is the most extendable way to update the Apex trigger to accomplish this?
  • PDII Exam Question 33

    A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data. What can a developer use to analyze and diagnose the problem in the Lightning page?
  • PDII Exam Question 34

    A developer is writing a Jest test for a Lightning web component that conditionally displays child components based on a user's checkbox selections. What should the developer do to properly test that the correct components display and hide for each scenario?
  • PDII Exam Question 35

    The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated. The test method fails at Line 20 because of "too many SOQL queries." What is the correct way to fix this?
    Java
    Line 12: //Set accounts to be customers
    Line 13: for(Account a : DataFactory.accounts)
    Line 14: {
    Line 15: a.Is_Customer__c = true;
    Line 16: }
    Line 17:
    Line 18: update DataFactory.accounts;
    Line 19:
    Line 20: List<Account> acctsAfter = [SELECT Number_Of_Transfers__c FROM Account WHERE Id IN :
    DataFactory.accounts];