Salesforce PDII Exam (page: 15)
Salesforce Certified Platform Developer II
Updated on: 25-Dec-2025

Viewing Page 15 of 86

What is a best practice when unit testing a controller? (Choose two.)

  1. Simulate user interaction by leveraging Test.setMock()
  2. Verify correct references by using getURL()
  3. Access test data by using seeAllData=true
  4. Set query parameters by using getParameters().put

Answer(s): B,D



What Visualforce tag can be used to display custom messages in pages using the Salesforce UI styling for errors, warnings, and other types of messages?

  1. <apex:customMessage>
  2. <apex:error>
  3. <apex:message>
  4. <apex:pageMessage>

Answer(s): D



A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?

  1. Implement a custom System.CalloutException class
  2. Include Database.AllowCallout() in the class definition
  3. Implement an @future method for the callout, and invoke it from the batch
  4. Specify "callout=true" in the batch implementation

Answer(s): B



A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.

How can the developer meet these requirements? (Choose two.)

  1. Use a StandardSetController
  2. Use CURSOR 50 in SOQL queries
  3. Use OFFSET in SOQL queries
  4. Use LIMIT 50 in SOQL queries

Answer(s): C,D



A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?

  1. Publicly expose a Visualforce page via Force.com Sites
  2. Create a web service on Heroku that uses Heroku Connect
  3. Host a Web-to-Lead form on the company website
  4. Publicly expose an Apex Web Service via Force.com Sites

Answer(s): B



Viewing Page 15 of 86



Share your comments for Salesforce PDII exam with other users:

Farooqi 11/21/2023 1:37:00 AM

good for practice.
INDIA