Certified Platform Developer II Practice Test

Certified Platform Developer II Practice Test practice questions, page 7 of 17, with answer review and explanations.

Question 31

What are three benefits of using declarative customizations over code? (Choose three.)

  1. Declarative customizations cannot generate run time errors.
  2. Declarative customizations will automatically update with each Salesforce release.
  3. Declarative customizations do not require user testing.
  4. Declarative customizations are not subject to governor limits.
  5. Declarative customizations generally require less maintenance.

Question 32

Which use case can only be performed by using asynchronous Apex?

  1. Scheduling a batch process to complete in the future
  2. Processing high volumes of records
  3. Updating a record after the completion of an insert
  4. Calling a web service from an Apex trigger

Question 33

@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?

  1. Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
  2. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
  3. Add Test.startTest() before and Test.stopTest() after insert acct.
  4. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).

Question 34

A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account. What is the optimal way to implement this?

  1. Perform a REST GET on the Account and a REST POST to update the Order__c with the Account's record ID.
  2. Perform a REST PATCH to upsert the Order__c and specify the Account's Customer_Number__c in it.
  3. Perform a REST POST to update the Order__c and specify the Account's Customer_Number__c in it.
  4. Perform a REST GET on the Account and a REST PATCH to upsert the Order__c with the Account's record ID.

Question 35

What are three benefits of using static resources in Visualforce and Lightning Components? (Choose three.)

  1. Static resource files are automatically minified.
  2. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
  3. Static resource files can be packaged into a collection of related files in a zip or jar archive.
  4. Static resource files do not count against an organization's quota of data storage.
  5. Relative paths can be used in files in static resource archives to refer to other content within the archive.