Free Certified Platform Developer II Exam Braindumps (page: 2)

Page 2 of 90

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?

  1. Remove the Database.setSavepoint and Database.rollback.
  2. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
  3. Change the CalloutUtil.makeRestCallout to an @future method.
  4. Move the CalloutUtil.makeRestCallout method call below the catch block.

Answer(s): C



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?

  1. Add an <apex:actionFunction> within the <apex:selectOptions>.
  2. Add an <apex:actionFunction> within the <apex:selectList>.
  3. Add an <apex:actionSupport> within the <apex:selectList>.
  4. Add an <apex:actionSupport> within the <apex:selectOptions>.

Answer(s): C





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?

  1. Add Test.startTest() before and Test.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  2. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
  3. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
  4. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

Answer(s): B



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?

  1. Ensure queries do not exceed governor limits.
  2. Ensure properties are marked as Transient.
  3. Ensure properties are marked as private.
  4. Ensure profiles have access to the Visualforce page.

Answer(s): B



Page 2 of 90



Post your Comments and Discuss Salesforce Certified Platform Developer II exam with other Community members:

Jenil Gandhi commented on November 14, 2024
Hi everyone could sone share the certification voucher for PD2.
INDIA
upvote

Aniq commented on December 02, 2023
Hi every one Could some share the certification voucher for PD2
Anonymous
upvote

Rasheed commented on June 07, 2023
Worth the price. I got 50% off when I selected 2 exams.
PAKISTAN
upvote

Lisha commented on September 21, 2022
Thank you!
Anonymous
upvote