Free Salesforce Platform Developer Practice Test Questions
184 questionsUpdated 18-Nov-2026
Question 41Choose 1
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?
Correct answer:
A. A Visualforce page in Salesforce Classic and a Lightning component 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.
Question 42Choose 1
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"?
Correct answer:
A. FIND "Universal Containers" IN ALL FIELDS RETURNING Lead(Id, Name),
Account(Id,Name), Contract(Id, Name)
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
Question 43Choose 2
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
Correct answer:
A. Use a Test Date Factory class.
B. Use the @raTeat (seeAllData=true) annotation.
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.
Question 44Choose 2
Which two events need to happen when deploying to a production org?
Correct answer:
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.
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.
Question 45Choose 3
What are three ways for a developer to execute tests in an org? Choose 3.
Correct answer:
B. Tooling API
C. Setup Menu
D. Salesforce DX
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.
Question 46Choose 3
For which three items can a trace flag be configured? Choose 3 answers
Correct answer:
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.
That's the last free question
You've seen the free 25% of every topic (46 of 184 questions). Get complete access for every question, explanation and the timed exam simulator.
Our timed 2026 Salesforce Platform Developer practice test mirrors the 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. The simulation builds your speed and stamina, so you walk in knowing exactly what to expect.