Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
 

Salesforce Certified Platform Developer II Exam Actual Questions

The questions for Certified Platform Developer II were last updated on Nov. 13, 2024.
  • Viewing page 1 out of 43 pages.
  • Viewing questions 1-10 out of 424 questions

Topic 1 - Single Topic

Question #1 Topic 1

A Visualforce page loads slowly due to the large amount of data it displays.
Which strategy can a developer use to improve the performance?

  • A. Use Javascript to move data processing to the browser instead of the controller.
  • B. Use the transient keywords for the List variables used in the custom controller.
  • C. Use lazy loading to load the data on demand, instead of the controller's constructor.
  • D. Use an <apex:actionPoller> in the page to load all of the data asynchronously.
Reveal Solution Hide Solution   Discussion   5

Correct Answer: C 🗳️

Question #2 Topic 1

Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments' containers, based on a junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?

  • A. A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records
  • B. A Custom List View on the junction object with filters that will show the proper records based on owner
  • C. A Custom Report Type and a report Lightning Component on the Community Home Page
  • D. An Apex Trigger that creates Apex Managed Sharing records based on the junction object's relationships
Reveal Solution Hide Solution   Discussion   9

Correct Answer: C 🗳️

Question #3 Topic 1

Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth.
What would allow Universal Containers to switch vendors without updating the code to handle authentication?

  • A. Custom Metadata
  • B. Custom Setting (List)
  • C. Dynamic Endpoint
  • D. Named Credential
Reveal Solution Hide Solution   Discussion   3

Correct Answer: D 🗳️

Question #4 Topic 1

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?

  • A. Salesforce Lightning Inspector Actions Tab
  • B. Salesforce Lightning Inspector Event Log Tab
  • C. Salesforce Lightning Inspector Transactions Tab
  • D. Salesforce Lightning Inspector Storage Tab
Reveal Solution Hide Solution   Discussion   2

Correct Answer: D 🗳️

Question #5 Topic 1

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error.
What should be done to address the problem?

  • A. Remove the Database.setSavepoint and Database.rollback.
  • B. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
  • C. Change the CalloutUtil.makeRestCallout to an @future method.
  • D. Move the CalloutUtil.makeRestCallout method call below the catch block.
Reveal Solution Hide Solution   Discussion   7

Correct Answer: C 🗳️

Question #6 Topic 1

A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.
<apex:selectList value="{!selectedIndustry}">
<apex:selectOptions values="{!industries}"/>
</apex:selectList>
When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?

  • A. Add an <apex:actionFunction> within the <apex:selectOptions>.
  • B. Add an <apex:actionFunction> within the <apex:selectList>.
  • C. Add an <apex:actionSupport> within the <apex:selectList>.
  • D. Add an <apex:actionSupport> within the <apex:selectOptions>.
Reveal Solution Hide Solution   Discussion   7

Correct Answer: B 🗳️

Question #7 Topic 1


The test method above calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to
True when it completes. The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts. "
What is the optimal way to fix this?

  • A. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  • B. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  • C. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
  • D. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
Reveal Solution Hide Solution   Discussion   9

Correct Answer: B 🗳️

Question #8 Topic 1

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production.
What should the developer ensure to correct these errors?

  • A. Ensure queries do not exceed governor limits.
  • B. Ensure properties are marked as Transient.
  • C. Ensure properties are marked as private.
  • D. Ensure profiles have access to the Visualforce page.
Reveal Solution Hide Solution   Discussion   5

Correct Answer: B 🗳️

Question #9 Topic 1

<lightning:layout multipleRows="true">
<lightning:layoutItem size="12">{!v.account.Name}
</lightning:layoutItem>
<lightning:layoutItem size="12">{!v.account.AccountNumber}
</lightning:layoutItem>
<lightning:layoutItem size="12">{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>
Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet.
Which option has the correct component changes to display correctly on desktops and tablets?

  • A. <lightning:layout multipleRows="true"> <lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.Name} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.AccountNumber} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.Industry} </lightning:layoutItem> </lightning:layout>
  • B. <lightning:layout multipleRows="true"> <lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.Name} </lightning:layoutItem> <lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.AccountNumber} </lightning:layoutItem> <lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.Industry} </lightning:layoutItem> </lightning:layout>
  • C. <lightning:layout multipleRows="true"> <lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.Name} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.AccountNumber} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.Industry} </lightning:layoutItem> </lightning:layout>
  • D. <lightning:layout multipleRows="true"> <lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.Name} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.AccountNumber} </lightning:layoutItem> <lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.Industry} </lightning:layoutItem> </lightning:layout>
Reveal Solution Hide Solution   Discussion   8

Correct Answer: C 🗳️

Question #10 Topic 1

A company's support process dictates that any time a Case is closed with a Status of 'Could not fix', an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case.
What is the correct way to automate this using an Apex trigger?

  • A. An after update trigger that creates the Engineering Review record and inserts it
  • B. A before update trigger that creates the Engineering Review record and inserts it
  • C. An after upsert trigger that creates the Engineering Review record and inserts it
  • D. A before upsert trigger that creates the Engineering Review record and inserts it
Reveal Solution Hide Solution   Discussion   4

Correct Answer: A 🗳️

Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...