Certified Platform Developer II Exam Dumps & Practice Test
Certified Platform Developer II Questions 176–180 (page: 37)

Updated On: 10-Feb-2026

How would you test a web service?

  1. Use the @future annotation on the method
  2. Call the WebService interface
  3. Web Services do not need to be tested
  4. Create a class that implements the WebServiceMock interface

Answer(s): D

Explanation:

Write a fake response in the doInvoke method Mark this class with an @isTest annotation. That way, it gets excluded from your org's size limit in test method, call Test.setMock(WebServiceMock.class, [mock class name])



Which of the following about Dynamic Apex is incorrect?

  1. You can retrieve the sObject type from an Id by calling .getSObjectType()
  2. getDescribe() can get you a variety of info on a particular object/field
  3. Schema.getGlobalDescribe() gives you a map of all sObject
  4. In dynamic SOQL, you can use bind variables and bind variable fields

Answer(s): D

Explanation:

While you can use simple bind variables in dynamic SOQL, you cannot use bind variable fields (e.g. :myVariable.field1_c)
Use escapeSingleQuotes to prevent SOQL injection



Which of the following exceptions cannot be caught and will force an error? (Choose three.)

  1. LimitException
  2. AssertException
  3. SObjectExceptions
  4. DMLException
  5. License exceptions
  6. ListException

Answer(s): A,B,E

Explanation:

SObjectException occurs when accessing a field not queried, or you try to change a field during the wrong dml statement (i.e. an edit-only field being set on insert)
Custom exceptions must extend the "Exception" class



What is the best way to display field-level error messages in Lightning?

  1. ui:inputDefaultError
  2. ui:outputText
  3. aura:component
  4. apex:message

Answer(s): A



What is the transaction limit for SOQL queries?

  1. 20 (synchronous), 200 (async)
  2. 150 (synchronous), 20 (async)
  3. 150 (synchronous), 200 (async)
  4. 100 (synchronous), 200 (async)
  5. 200 (synchronous), 100 (async)

Answer(s): D



Viewing page 37 of 86
Viewing questions 1 - 0 out of 424 questions


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

AI Tutor AI Tutor 👋 I’m here to help!