Salesforce PDI Exam (page: 4)
Salesforce Certified Platform Developer I
Updated on: 28-Jul-2025

Viewing Page 4 of 77

A developer is asked to create a PDF quote document formatted using the company's branding guidelines, and automatically save it to the Opportunity record.
Which two ways should a developer create this functionality? (Choose two.)

  1. Install an application from the AppExchange to generate documents.
  2. Create a Visualforce page with custom styling.
  3. Create an email template and use it in Process Builder.
  4. Create a visual flow that implements the company's formatting.

Answer(s): A,B



How should a developer prevent a recursive trigger?

  1. Use a "one trigger per object" pattern.
  2. Use a static Boolean variable.
  3. Use a trigger handler.
  4. Use a private Boolean variable.

Answer(s): D



Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

  1. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
  2. Test data is inserted once for all test methods in a class.
  3. Records created in the @testSetup method cannot be updates in individual test methods.
  4. The @testSetup method is automatically executed before each test method in the test class is executed.

Answer(s): B,C

Explanation:

The @testSetup annotation is used to create a common set of records that can be used across all test methods in a test class. The primary benefit of using this annotation is to reduce the amount of redundant setup code needed in each individual test method. The @testSetup method is executed once per test class before any test methods are executed. The created data is available to all test methods in the class, but it cannot be updated by individual test methods.

Option A is incorrect because the @testSetup annotation can be used regardless of the @isTest(SeeAllData=True) annotation.

Option D is incorrect because the @testSetup method is only executed once per test class, not before each individual test method.



A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown.
Which step should the developer take to resolve the issue and properly test the exception?

  1. Use try/catch within the unit test to catch the exception.
  2. Use the finally bloc within the unit test to populate the exception.
  3. Use the database methods with all or none set to FALSE.
  4. Use Test.isRunningTest() within the custom controller.

Answer(s): A



A developer writes the following code:


What is the result of the debug statement?

  1. 1, 100
  2. 1, 150
  3. 2, 150
  4. 2, 200

Answer(s): C



Viewing Page 4 of 77



Share your comments for Salesforce PDI exam with other users:

TestPD1 8/10/2023 12:22:00 PM

question 18 : response isnt a ?
EUROPEAN UNION


TestPD1 8/10/2023 12:19:00 PM

question 17 : responses arent b and c ?
EUROPEAN UNION