Practice Free Plat-Dev-201 Exam Online Questions
Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?
- A . Standard Controller with Custom List Controller extension
- B . Custom List Controller with recorasetvar page attribute
- C . Controller Extension and <spex: listButton> tag
- D . Standard controller and the recordsetvar page attribute
D
Explanation:
TherecordSetVarattribute of the<apex: page>tag allows a Visualforce page to handle multiple records, which is ideal for list buttons that display a page for bulk editing.
Why not other options?
A: Standard controllers can be extended, but usingrecordSetVaris the direct and best-supported
method for this scenario.
B: There is no such concept as a "Custom List Controller" in Visualforce. C: <spex: listButton>is not a valid Visualforce tag.
Visualforce Standard Controller with RecordSetVar
Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account) ;
What occurs when more than one Account is returned by the SOQL query?
- A . The variable, myaccount, is automatically cast to the List data type.
- B . An unhandled exception is thrown and the code terminates.
- C . The query fails and an error is written to the debug log.
- D . The first Account returned is assigned to myAccount.
B
Explanation:
The SOQL query assigns its result directly to a single sObject variable (Account myAccount). If the query returns more than one record, Salesforce throws aQueryExceptionbecause the system cannot automatically cast multiple results to a single sObject.
Not Suitable:
Option A: The variable cannot be automatically cast to a list. Option C: The query itself does not fail but throws an exception. Option D: The first record is not automatically assigned. : SOQL Query Considerations
What should be used to create scratch orgs?
- A . Salesforce CLI
- B . Sandbox refresh
- C . Developer Console
- D . Workbench
A
Explanation:
Scratch orgs are created using the Salesforce CLI (sfdx force: org: create) as part of Salesforce DX. It is specifically designed for development and testing purposes.
Why not other options?
B: Sandbox refresh is used for creating sandboxes, not scratch orgs.
C: Developer Console is used for debugging and code development but cannot create scratch orgs.
D: Workbench is a tool for API testing and data manipulation, not for scratch org creation.
: Salesforce CLI and Scratch Orgs
The following Apex method is part of the ContactService class that is called from a trigger:

How should the developer modify the code to ensure best practices are met?
A)

B)

C)

- A . Option A
- B . Option B
- C . Option C
A
Explanation:
Best practices in Apex development for triggers and service layers include:
Avoiding DML operations and queries in loops.
Handling bulk processing efficiently.
Option A ensures compliance by performing all updates at the end, reducing the risk of hitting governor limits.
A developer wrote Apex code that calls out to an external system using REST API.
How should a developer write the test to prove the code is working as intended?
- A . Write a class that implements HTTPcalloutMock.
- B . Write a class that extends webserviceloo.
- C . Write a class that implements webservicemock.
- D . Write a class that extends HTTPcalloutMock.
A
Explanation:
To test Apex code that makes HTTP callouts, Salesforce provides theHTTPCalloutMockinterface. Developers create a test class that implementsHTTPCalloutMockto define the fake response that will be returned when the callout is executed during the test.
This ensures that tests do not depend on the availability or behavior of the external system.
Why not other options?
BandC: These are not relevant for testing HTTP callouts.
D: There is no concept of extendingHTTPCalloutMock. It is implemented, not extended.
: Apex Testing for HTTP Callouts
Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class ContactInfo.
Which is the correct definition of the Apex method that gets the additional information?
- A . @InvocableMethod (label=’Additional Info’) public ContactInfo getInfo (Id contactId) { /* implementation */ }
- B . @InvocableMethod (label=’Additional Info’) public static List<ContactInfo> getInfo (List<Id> contactIds) { /* implementation */ }
- C . @InvocableMethod (label=’Additional Info’) public static ContactInfo getInfo (Id contactId) { /* implementation */ }
- D . @InvocableMethod (label=’Additional Info’) public List<ContactInfo> getInfo (List<Id> contactIds) { /* implementation */ }
B
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
B (Correct): Apex methods exposed toFlowmust be:
Static
Annotated with @InvocableMethod
Accept aListof parameters (for bulkification)
Return aList of custom class objects
This method signature supports Flow Builder’s bulk processing model, which is required in enterprise scenarios where the Flow might process multiple records.
Reference: Apex Developer Guide C InvocableMethod Annotation
This relates toProcess Automation and Logic (30%) in the PD1 exam, especially around "leveraging Apex with Flow."
What are two ways for a developer to execute tests in an org? Choose 2 answers
- A . Tooling API
- B . Metadata API
- C . Bulk API
- D . Developer Console
A,D
Explanation:
Tooling API:
The Tooling API provides programmatic access to manage tests and other metadata in the org.
It can execute test classes or methods remotely.
Developer Console:
The Developer Console is a built-in Salesforce tool to execute Apex tests, debug logs, and more.
Allows developers to execute tests interactively.
B. Metadata API: Used for managing metadata, not for running tests.
C. Bulk API: Used for data operations, not related to testing.
Reference: Tooling API Overview: https: //developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/
Testing with Developer
Console: https: //help.salesforce.com/s/articleView?id=sf.code_dev_console_test.htm
A developer must troubleshoot to pinpoint the causes of performance issues when a custom page
loads in their org.
Which tool should the developer use to troubleshoot query performance?
- A . Setup Menu
- B . Visual Studio Code IDE
- C . AppExchange
- D . Developer Console
D
Explanation:
Why Developer Console?
The Developer Console provides tools to troubleshoot query performance, including the Query Plan tool.
The Query Plan tool evaluates SOQL query performance and provides insight into query costs and optimization.
Why Not Other Options?
A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component.
In which two ways can this be accomplished? Choose 2 answers
- A . The parent component can invoke a public method in the child component.
- B . The parent component can use a public property to pass the data to the child component,
- C . The parent can use the Apex controller class to send data to the child component.
- D . The parent component can use a custom event to pass the data to the child component.
A,B
Explanation:
Public Method (A): The parent component can call a public method defined in the child component to pass data directly.
Reference: LWC Communication: Public Methods
Public Property (B): The parent component can bind data to a public property in the child component using the attribute syntax.
Reference: LWC Communication: API Properties
Incorrect Options:
C: Apex controllers are not used for direct communication between parent and child components.
D: Custom events are used for communication from child to parent, not parent to child.
What are two considerations for deploying from a sandbox to production? Choose 2 answers
- A . At least 75% of Apex code must be covered by unit tests.
- B . Unit tests must have calls to the System.assert method.
- C . Should deploy during business hours to ensure feedback can be quickly addressed.
- D . All triggers must have at least one line of test coverage.
A,D
Explanation:
