Free CERTIFIED-PLATFORM-DEVELOPER-II Salesforce CERTIFIED-PLATFORM-DEVELOPER-II Practice Test Question

Loading demo links...

Showing 4–6 of 28 questions

Question 4 (Topic 1)

@isTest static void testIncrement() { Account acct = new Account(Name = 'Test'); acct.Number_Of_Times_Viewed__c = 0; insert acct; AuditUtil.incrementViewed(acct.Id); Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0] System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c); } The test method above calls an @future method that increments the Number_of_Times_Viewed__c value. The assertion is failing because the Number_of_Times_Viewed__c equals 0. What is the optimal way to fix this?

Select an option, then click Submit answer.

  • Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
  • Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
  • Add Test.startTest() before and Test.stopTest() after insert acct.
  • Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).
Question 5 (Topic 1)

Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b. These are the fields on Customer_Transaction__b: Account__c - Program__c - Points_Earned__c - Location__c - Transaction_Date__c - The following fields have been identified as Index Fields for the Customer_Transaction__b object: Account__c, Program__c, and Transaction_Date__c. Which SOQL query is valid on the Customer_Transaction__b Big Object?

Select an option, then click Submit answer.

  • SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c ='Shoppers' AND Transaction_Date__c=2019-05-31T00:00Z
  • SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c LIKE 'Shop%' AND Transaction_Date__c=2019-05-31T00:00Z
  • SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c INCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z
  • SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = '001R000000302D3' AND Program__c EXCLUDES ('Shoppers', 'Womens') AND Transaction_Date__c=2019-05-31T00:00Z
Question 6 (Topic 1)

Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?

Select an option, then click Submit answer.

  • Apex Batch job that counts the number of Opportunity records
  • SUM() SOQL aggregate query on the Opportunity object
  • SOQL for loop that counts the number of Opportunities records
  • COUNT() SOQL aggregate query on the Opportunity object