Skip to main content

PDI Real Exam Questions

Salesforce Certification for Platform Developer I (Plat-Dev-201)

270 questions available · Page 1 of 27

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

A developer is migrating a Visualforce page into a Lightning web component.

The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.

Which security consideration should the developer be aware of?

  1. A

    Lightning Data Service ignores field-level security.

  2. B

    The with sharing keyword must be used to enforce sharing rules.

  3. C

    Lightning Data Service handles sharing rules and field-level security.

  4. D

    The isAccessible () method must be used for field-level access checks.

Show answer and explanation

Correct answer: C

Explanation

Why Lightning Data Service?

Enforces Salesforce's security model, including:

Sharing rules.

Field-level security (FLS).

This eliminates the need for additional manual security checks.

Why Not Other Options?

A: Incorrect, LDS enforces FLS.

B: with sharing applies to Apex, not Lightning Data Service.

D: isAccessible() is unnecessary for LDS because it already enforces FLS.

Lightning Data Service:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/
data_service.htm

Question 2 Single choice

While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors.

Why did the method fail in the sandbox test framework but succeed in the Developer Console?

  1. A

    The test method does not use system. runAs to execute as a specific user.

  2. B

    The test method is calling an @future method.

  3. C

    The test method relies on existing data in the sandbox.

  4. D

    The test method has a syntax error in the code.

Show answer and explanation

Correct answer: C

Explanation

Test Isolation Principle:

Apex test methods run in a sandboxed environment without access to existing org data unless seeAllData=true is used.

The test fails if it relies on data not created within the test itself.

Why Not Other Options?

A: runAs simulates user context but does not affect test isolation.

B: @future methods do not cause failures if handled correctly.

D: Syntax errors would prevent code compilation.

Test Data Isolation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/
apex_testing_data.htm

Question 3 Single choice

Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name.

What is the best solution to assign the case to the appropriate support representative?

  1. A

    Use a trigger on the Case object.

  2. B

    Use a formula field on the Case object.

  3. C

    Use a validation rule on the Case object.

  4. D

    Use an Assignment Flow element.

Show answer and explanation

Correct answer: D

Explanation

A Flow with an Assignment element is the best declarative solution to assign cases based on criteria such as Case Origin. It can automatically evaluate the value of the Case Origin and assign the support representative.

Why not other options?

A: Using a trigger is a programmatic approach and less ideal when declarative tools can solve the problem.

B: A formula field cannot assign values; it only calculates and displays results.

C: Validation rules are used to enforce constraints, not for assigning values.

References:
Salesforce Flows Overview

Question 4 Single choice

A company has a custom object, order__c, that has a required, unique external ID field called order Number__c.

Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of Order__c records using the external ID field?

  1. A

    merge orders;

  2. B

    merge orders Order Number_c;

  3. C

    upsert orders Order Number c;

  4. D

    upsert orders;

Show answer and explanation

Correct answer: C

Explanation

The upsert DML operation uses an external ID field to determine whether to insert a new record or update an existing one. Specifying Order_Number__c tells Salesforce to match records using that unique external ID. merge is used for deduplication, not external IDs, and upsert orders; without specifying the external ID
relies on record Ids instead.

Question 5 Single choice

A developer needs to allow users to create a record from a Lightning record page with some fields automatically populated. JavaScript buttons are no longer supported in Lightning Experience.

Which feature should be used?

  1. A

    Apex trigger

  2. B

    Record-triggered Flow

  3. C

    Quick Action

  4. D

    Validation rule

Show answer and explanation

Correct answer: C

Explanation

Quick Actions are the modern replacement for JavaScript buttons in Lightning Experience. They allow developers and administrators to define actions that users can initiate from a record page, including creating or updating records with predefined field values. Quick Actions support prepopulation of fields, provide a consistent user experience across desktop and mobile, and do not require custom JavaScript.
Triggers and flows can automate logic but are not designed for direct user-initiated record creation from the UI. Validation rules only enforce constraints and do not create or populate records.

Question 6 Single choice

The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists across different objects.

What is an approach a developer can take to streamline maintenance of the picklists and their values, while also restricting the values to the ones mentioned above?

  1. A

    Create the Picklist on each object and use a Global Picklist Value Set containing the values.

  2. B

    Create the Picklist on each object as a required field and select "Display values alphabetically, not in the order entered".

  3. C

    Create the Picklist on each object and add a validation rule to ensure data integrity.

  4. D

    Create the Picklist on each object and select "Restrict picklist to the values defined in the value set".

Show answer and explanation

Correct answer: A

Explanation

A Global Picklist Value Set allows the same set of picklist values to be shared across multiple objects, making maintenance easier and ensuring consistency.

Why not other options?

B: Alphabetical ordering does not ensure consistent value maintenance across objects.

C: Validation rules do not streamline picklist value maintenance.

D: Restricting picklist values helps ensure data integrity but does not streamline maintenance across objects.

References:
Global Picklists Documentation

Question 7 Multiple choice

A developer completed modifications feature that is comprised of two elements:

1. Apex trigger
2. Trigger handler Apex class

What are two factors that the developer must take into account to properly deploy them to the production environment? Choose 2 answers

  1. A

    Apex classes must have at least 75% code coverage org-wide.

  2. B

    All methods in the test classes must use @istest.

  3. C

    At least one line of code must be executed for the Apex trigger.

  4. D

    Test methods must be declared with the testMethod keyword.

Show answer and explanation

Correct answers: A, C

Explanation

75% Code Coverage (A):To deploy Apex code to production, Salesforce requires at least 75% of the code to be covered by tests across the organization.

Question 8 Single choice

A developer created this Apex trigger that calls MyClass,myStartmethod:

trigger my Trigger on Contact (before insert)

[ MyClass.myStatilcMethed(trigger.new); ]

The developer creates a test method that calls MyClase, myStartmethod directly, resulting in 81% overall code coverage.

What happens wtier the developer tries to deploy the ...
and two classes to production, assuming no other code exists?

  1. A

    The deployment fails because the Apr-MgQM has no code coverage.

  2. B

    The deployment tails because no assertions mett made in the lest method.

  3. C

    The deployment passes became the Apex code has the requited 75% code coverage.

  4. D

    The deployment passes because both classes and the trigger were included ki the deployment.

Show answer and explanation

Correct answer: A

Question 9 Single choice

The Salesforce Administrator created a custom picklist field, Account_status_c, on the a Account object.
This picklist has possible values of Inactive'' and Active?

As part of a new business process, management wants to ensure an opportunity record is created only for Accounts marked as "Active". A developer is asked to implement this business requirement.

Which two automation tools should be used to fulfill the business need? Choose 2 answers

  1. A

    Salesforce Flow

  2. B

    Approval Process

  3. C

    Process Builder

  4. D

    Workflow Rules

Show answer and explanation

Correct answer: A

Question 10 Single choice

Universal Container wants Opportunities to no longer be editable when reaching the Clousd stage.

How should a develoiper accomplish this?

  1. A

    Use the Process Automation setting.

  2. B

    Mark fields as read-only on the page layout.

  3. C

    Use flow Builder

  4. D

    Use a validation rule.

Show answer and explanation

Correct answer: D