Total 184 Questions
Last Updated On : 6-Oct-2026
A developer must provide custom user interfaces when users edit a Contact in either Salesforce Classic or Lightning Experience. What should the developer use to override the Contact's Edit button and provide this functionality?
A. A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience
B. A Lightning component in 5alesforce Classic and a Lightning component in lightning Experience
C. A Visualforce page in Salesforce Classic and a Lightning page in Lightning Experience
D. A Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience
Explanation:
Salesforce allows developers to override standard buttons like Edit with custom user interfaces, but the technology used depends on the UI experience:
βοΈ For Salesforce Classic:
You can only override buttons using Visualforce pages.
Lightning components do not run in Classic.
βοΈ For Lightning Experience:
You can override buttons with Lightning components (Aura or LWC).
This allows for modern, responsive UI.
π§ Override Configuration:
When overriding the Edit button on the Contact object, Salesforce lets you specify:
A Visualforce Page for Classic
A Lightning Component for Lightning Experience
β Why other options are incorrect:
B. Lightning component in both Classic and Lightning
β Lightning components cannot run in Classic.
C. Visualforce page and Lightning page
β Lightning pages (App Builder pages) are not valid for button overrides.
D. Lightning page in Classic and Visualforce in Lightning
β Lightning pages donβt work in Classic, and Visualforce in Lightning defeats the purpose of a native Lightning experience.
What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contracts that have the company name "Universal Containers"?
A. FIND "Universal Containers" IN ALL FIELDS RETURNING Lead(Id, Name), Account(Id,Name), Contract(Id, Name)
B. FIND "Lead(Id, Name), Account(Id, Name), Contract(Id, Name) FROM SALA WHEREName = "Universal Containers"
C. FIND "Universal Containers" IN Name Fields RETURNING Lead(Id, Name), Account(Id,Name), Contract(Id, Name)
D. FIND "Lead(Id, Name), Account(Id, Name), Contract(Id, Name) FROM Lead, Account,Contract WHERE Name = "Universal Containers"
Explanation:
Why A is correct: The requirement involves searching across multiple distinct objects (Leads, Accounts, and Contracts) for a specific text value ("Universal Containers"). This requires a SOSL (Salesforce Object Search Language) query. The correct SOSL syntax uses the FIND clause followed by the search term, an optional IN clause (defaulting to ALL FIELDS if not specified or explicitly stated as IN ALL FIELDS), and a RETURNING clause that specifies the objects and the fields (Id, Name) to retrieve.
Why the other options are incorrect:
B & D: These options attempt to use SOQL (Salesforce Object Query Language) syntax (like FROM Lead, Account... or WHERE Name = ...), which is invalid. SOQL queries can only query one primary object at a time (though you can traverse relationships), and they use SELECT, not FIND. Furthermore, Contracts do not have a Name field; they use a ContractNumber field, meaning a standard SOQL equality check on Name for a Contract would fail.
C: While IN Name Fields restricts the search to name fields only, the prompt asks for leads, accounts, and contracts with the company name "Universal Containers." In Salesforce, Accounts and Leads have a Company field, and SOSL searching across multiple objects for a company name string typically utilizes IN ALL FIELDS or IN Name Fields, but option A correctly provides the standard syntax structure. Wait, let's verify if IN ALL FIELDS or IN Name Fields is typically preferred or if both workβactually, IN ALL FIELDS is standard when searching across multiple objects where field names might differ (e.g., Account Name vs Company vs Contract fields). Let's double-check standard Salesforce exam phrasing for SOSL.
Reference:
Salesforce Object Query Language and Object Search Language (SOQL and SOSL) Guide: SOSL Syntax
Salesforce Developer Guide: RETURNING Clause
A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records. hich two approaches can the developer use to ensure Pricing _Structure c records are available when the test class is executed? Choose 2 answers
A. Use a Test Date Factory class.
B. Use the @raTeat (seeAllData=true) annotation.
C. Use the Test. leadtear{} method,
D. Use without shering on the class declaration.
Explanation:
When writing test classes in Apex, the goal is to ensure that all required test data is created or made available during the test execution. Letβs look at the two valid options:
βοΈ A. Use a Test Data Factory class
β
Recommended best practice
A Test Data Factory is a reusable class designed to create test data (e.g., 500 Pricing_Structure__c records).
It improves test reliability, readability, and maintainability.
Keeps test methods clean by separating data setup from test logic.
βοΈ B. Use the @isTest(seeAllData=true) annotation
β
Allows access to actual org data during test execution.
Can be used if 500+ Pricing_Structure__c records already exist and are too complex to replicate.
β οΈ Not recommended for managed packages or long-term maintainability, as it's not future-proof (data may change or be deleted).
β Incorrect Options:
C. Use the Test.loadData() method
β This option is not listed, but if you meant Test.loadData(), that could work only if a static .csv file is available.
However, Test.leadtear{} is not a valid Apex method β possibly a typo.
D. Use without sharing on the class declaration
β This affects record visibility, not data availability.
It allows access to records the running user doesn't own or have access to, but doesn't create or load data for tests.
Which two events need to happen when deploying to a production org?
A. All Apex code must have at least 75% test coverage.
B. All custom objects must have visibility set to a value other than In Development.
C. All Visual flows must have at least 1% test coverage.
D.
Explanation\;
A. All Apex code must have at least 75% test coverage.
Correct. When deploying Apex to a production org, Salesforce requires the deployment to meet the required Apex test coverage threshold. The standard requirement is at least 75% overall Apex code coverage, and Apex tests must successfully pass.
B. All custom objects must have visibility set to a value other than In Development.
Correct. Custom objects that are still in the In Development status cannot be deployed to production. They must be set to an appropriate deployment status before deployment.
C. All Visual flows must have at least 1% test coverage.
Incorrect. Salesforce does not require Visual Flows to have a 1% test-coverage requirement for production deployment in this manner.
Key Exam Point
For Salesforce production deployments, remember:
Apex: minimum 75% code coverage and tests must pass.
Custom objects: cannot remain In Development.
Flows: there is no general 1% flow test coverage requirement.
What are three ways for a developer to execute tests in an org? Choose 3.
A. Bulk API
B. Tooling API
C. Setup Menu
D. Salesforce DX
E. Metadata API.
Explanation:
Salesforce provides several ways for developers to execute tests in an org. Here's a breakdown:
βοΈ B. Tooling API
β
True
The Tooling API supports running tests programmatically, often used by IDEs and CI tools.
You can execute specific test classes or methods and retrieve code coverage results.
βοΈ C. Setup Menu
β
True
Developers and admins can run Apex tests directly from Setup by navigating to:
Setup β Apex Test Execution
βοΈ D. Salesforce DX (SFDX CLI)
β
True
Salesforce DX provides the sfdx force:apex:test:run command to run tests from the command line.
Widely used in automated CI/CD pipelines.
β Incorrect Options:
A. Bulk API
β Not used for running Apex tests
Designed for importing, exporting, and deleting large volumes of data.
E. Metadata API
β Used for deploying and retrieving metadata
Cannot run tests directly, though tests are run as part of deployments.
For which three items can a trace flag be configured? Choose 3 answers
A. Process Builder
B. Visualforce
C. Apex Class
D. Apex Trigger
E. User
Explanation:
A trace flag in Salesforce is used to enable debug logging for specific items. Hereβs how the correct answers apply:
βοΈ C. Apex Class
β
True
You can set a trace flag for a specific Apex Class to debug its behavior and execution.
βοΈ D. Apex Trigger
β
True
You can enable a trace flag on a specific Apex Trigger to log its execution.
βοΈ E. User
β
True
This is the most common use β enabling a trace flag for a user captures all code run in their context (e.g., when testing something in the UI or running a flow).
β Incorrect Options:
A. Process Builder
β False
You cannot configure trace flags directly for Process Builder. However, if it triggers Apex code, that can be traced.
B. Visualforce
β False
You cannot directly set a trace flag for a Visualforce page. You would trace the user or Apex class involved.
Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?
A. Use the schema describe calls to determine if the logged-in users has access to the Account object.
B. Use the without sharing keyword on the class declaration.
C. Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
D. Use the with sharing keyword on the class declaration.
Explanation:
In Salesforce, when you build custom Apex code (like a search tool), the Apex class by default does not enforce sharing rules unless explicitly stated. To ensure that users only see records they are allowed to see based on the org's sharing model (e.g., private sharing for Account), you need to declare the class with:
with sharing
This ensures the code respects record-level sharing rules for the currently logged-in user.
π Why the other options are incorrect:
A. Use the schema describe calls to determine access to the Account object
β This checks object-level permissions, not record-level sharing.
B. Use the without sharing keyword
β This explicitly ignores sharing rules, which is the opposite of what's needed here.
C. Use the UserInfo class to filter queries
β Manually filtering by owner is not sufficient β users may have access to records via sharing rules, roles, or teams, not just ownership.
A developer creates a custom exception as shown below: public class ParityException extends Exception {} What are two ways the developer can fire the exception in Apex? Choose 2 answers
A. new ParityException();:
B. throw new ParityException("parity does not match");
C. new ParityException('parity does not match');
D. throw new ParityException();
Explanation:
Given this custom exception declaration:
public class ParityException extends Exception {}
There are two valid ways to throw (fire) this exception in Apex:
βοΈ B. throw new ParityException("parity does not match");
β
Correct
You can pass a custom message to the exception constructor.
This message will be available via get Message().
βοΈ D. throw new ParityException();
β
Correct
You can throw the exception without passing any arguments.
This uses the default constructor.
β Incorrect Options:
A. new ParityException();
β Just instantiates the exception but does not throw it.
C. new ParityException('parity does not match');
β Similar to A β it creates the exception but does not throw it.
What are two use cases for executing Anonymous Apex code? Choose 2 answers
A. To delete 15,000 inactive Accounts In a single transaction after a deployment
B. To schedule an Apex class to run periodically
C. To run a batch Apex class to update all Contacts
D. To add unit test code coverage to an org
Explanation:
Here are the two correct use cases for executing Anonymous Apex:
Scheduling an Apex Class (B):
Anonymous Apex can schedule jobs using System.schedule().
Example:
System.schedule('Daily Update', '0 0 12 * * ?', new MyScheduledClass());
Running Batch Apex (C):
Anonymous Apex can launch batch jobs with Database.executeBatch().
Example:
Database.executeBatch(new UpdateContactsBatch(), 200);
Why Not the Others?
A. Deleting 15,000 Accounts in a single transaction:
Governor limit violation: Anonymous Apex has a 10,000-record DML limit. Use Batch Apex instead.
D. Adding unit test coverage:
Tests must be in test classes (@isTest). Anonymous Apex doesnβt count toward coverage.
Which three data types can a SOQL query return? Choose 3 answers
A. List
B. Long
C. Integer
D. sObJect
E. Double
Explanation:
A SOQL (Salesforce Object Query Language) query can return results in several data types, primarily collections of records (objects) or aggregate results. Hereβs how the correct answers break down:
A. List
β
True
SOQL typically returns a List of sObjects.
Example:
List
D. sObject
β
True
You can store a single record from a SOQL query directly in an sObject variable.
Example:
Account acc = [SELECT Id, Name FROM Account LIMIT 1];
E. Double
β
True
When using aggregate functions (like AVG() or SUM()), SOQL can return numeric values like Double.
Example:
AggregateResult[] result = [SELECT AVG(Amount) avgAmount FROM Opportunity];
Double average = (Double)result[0].get('avgAmount');
β Incorrect Options:
B. Long
β Not a return type for SOQL. While some fields might store long integers, SOQL itself doesn't return Long types directly.
C. Integer
β Similar to Long, SOQL does not return raw Integer values β even COUNT() typically returns Long.
| Page 5 out of 19 Pages |
| 234567 |
| Salesforce-Platform-Developer Practice Test Home |
Our new timed 2026 Salesforce-Platform-Developer practice test mirrors the exact format, number of questions, and time limit of the official exam.
The #1 challenge isn't just knowing the material; it's managing the clock. Our new simulation builds your speed and stamina.
You've studied the concepts. You've learned the material. But are you truly prepared for the pressure of the real Salesforce Certified Platform Developer - Plat-Dev-201 exam?
We've launched a brand-new, timed Salesforce-Platform-Developer practice exam that perfectly mirrors the official exam:
β
Same Number of Questions
β
Same Time Limit
β
Same Exam Feel
β
Unique Exam Every Time
This isn't just another Salesforce-Platform-Developer practice questions bank. It's your ultimate preparation engine.
Enroll now and gain the unbeatable advantage of: