Key details for this exam, checked against the published exam outline
Each question shows the correct answer and an explanation of why it is right
As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?
When multiple components on a single page all fail simultaneously (for example, due to a shared service failure), individual toast messages stack up, creating a poor user experience. To resolve this, developers should shift away from 'ephemeral' notifications like toasts toward more structured error handling.
Option A involves creating a dedicated error-handling component. This component can act as a listener or a central repository for errors across the page. Instead of each component firing its own toast, they can communicate their error state to this central component, which aggregates the messages into a single, clean display. This reduces visual clutter and allows the user to read all errors in one place.
Option C refers to 'in-place' error handling. Using conditional rendering (the lwc:if or template if:true directives), a component can hide its normal UI and display an error message exactly where the component would have been. This provides immediate context to the user about which specific part of the page failed without interrupting the overall flow with pop-ups.
Option B (window.alert) is considered a legacy practice that blocks the browser thread and is generally avoided in modern web development. Option D (public properties) is a mechanism for component communication but doesn't solve the display problem itself. Combining A and C provides a modern, professional, and less intrusive error-handling strategy.
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users encounter "View State" errors when using it in production. What should the developer ensure to correct these errors?
The Visualforce View State is a hidden form field that maintains the state of the page (including controller variables) between server requests. 9Salesforce imposes a strict 135KB limit on the View State. When a page handles large amounts of 10data---such as large lists of records or complex objects---the serialized size of the controller variables can easily exceed this limit, resulting in a runtime error for the user.
To correct these errors, the developer should use the transient keyword (Option C). Marking a variable as transient prevents it from being serialized into the View State. This is the standard best practice for any data that does not need to be maintained across 'postbacks' (actions that refresh the page or part of the page). Common candidates for the transient keyword include:
Large lists of records retrieved for display only.
Temporary variables used for calculations during a single request.
Summary data that can be easily re-queried if needed.
Option A relates to security, not performance. Option B (private variables) does not exclude variables from the View State; only static and transient variables are excluded. Option D relates to SOQL governor limits, which are independent of the View State size. By judiciously using transient, the developer keeps the page weight low and ensures a smooth user experience in production environments with real-world data volumes.
Universal Containers wants to develop a recruiting app for iOS and Android via the standard Salesforce mobile app. It has a custom user interface design and offline access is not required. What is the recommended approach to develop the app?
When developing custom functionality to be surfaced within the standard Salesforce Mobile App, Lightning Web Components (LWC) (Option B) is the recommended approach. LWCs are the modern, high-performance standard for Salesforce development, utilizing modern web standards (ES6+, Web Components) that run natively in the browser.
LWC is preferred over the other options for several reasons:
Performance: LWCs are lightweight and provide a much faster, more responsive user interface than Visualforce (Option D), which is critical for mobile user experience.
Standardization: Since the app will be accessed via the standard Salesforce mobile app, LWCs integrate seamlessly into the mobile navigation, tabs, and action menus.
Customization: LWCs provide full control over the CSS and HTML, allowing the developer to meet the 'custom user interface design' requirement while still leveraging the Lightning Data Service for efficient data handling.
Option A (Salesforce SDK) is for building 'Custom/Native' standalone apps, not for extending the standard Salesforce app. Option C (Experience Builder) is primarily for external sites (Communities). LWC provides the perfect balance of 'custom design' and 'native integration' for internal mobile users.
A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record. Which best practice should the developer use to perform the validations on more than one field, thus allowing more than one error message to be displayed simultaneously?
When using lightning-record-edit-form, server-side validation rules (Option D) typically return errors one at a time as the database engine encounters them, or as a single combined toast message that can be difficult to parse. To provide a superi1or user experience where multiple fields are validated simultaneously before the data even reaches the server, the develo2per shou3ld implement Client-side validation (Option B).
In the component's JavaScript controller, the developer can intercept the onsubmit event. By iterating through all the lightning-input-field or standard lightning-input elements, the developer can programmatically check for various conditions (e.g., custom regex patterns, conditional logic between fields, or range checks). Each field can then be marked with a custom error message using the reportValidity() or setCustomValidity() methods. This allows the UI to highlight all invalid fields at once, providing immediate, comprehensive feedback to the user. This approach reduces unnecessary server round-trips and ensures that the user can correct all issues in a single pass before successfully submitting the record.
A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes. Which tool or mechanism should be utilized for managing the source-driven deployment process?78
1920
Source-driven development shifts th21e 'source of truth' from the Salesforce Org to a Version Control System (like Git). To b22ridge the gap between local source code and the Salesforce platform, Salesforce CLI with Salesforce DX (Option C) is the required mechanism.
Salesforce DX (Developer Experience) introduced a source-centric metadata format that is more granular and easier to track in version control than the traditional Metadata API. The Salesforce CLI provides the command-line tools necessary to automate the deployment process, create scratch orgs for isolated testing, and perform 'source tracking' to identify exactly which files have changed. This is the foundation of modern CI/CD (Continuous Integration/Continuous Delivery) pipelines in the Salesforce ecosystem.
In contrast, Change Sets (Option B) are org-centric and manual, making them incompatible with automated version control. Data Loader (Option A) is for record data, not metadata. Unmanaged Packages (Option D) are used for distribution but do not support the iterative, source-controlled deployment workflow required for professional project management.
161 questions covering all exam domains, starting from $20
Exam domains verified against: Official Salesforce Plat-Dev-301 exam guide, last checked August 2026.
Understand localization and multi-currency features and their coding implications. Learn when to use sharing objects and Apex managed sharing, and how to select appropriate custom metadata and custom settings implementations.
Sample question from this domain above: Q5
Master interactions between declarative and programmatic processes. Develop expertise in Apex triggers, error handling, advanced SOQL, asynchronous Apex, dynamic Apex features, platform events, and integration techniques for both inbound and outbound communication.
Sample question from this domain above: Q2
Analyze Apex controllers for Lightning web components and Aura components. Build responsive components across devices, handle error display, communicate between components, and use static resources effectively in Visualforce, LWC, and Aura.
Apply advanced testing techniques including mocks and stubs for Apex. Debug Lightning components, Visualforce, and JavaScript. Isolate root causes in non-executing code and formulate source-driven deployment processes using appropriate tools.
Identify UI performance issues and mitigation techniques. Optimize query structure for large data volumes. Recognize where asynchronous callouts improve performance and code reuse opportunities. Resolve inefficiencies in sample code.
Sample question from this domain above: Q3
Common questions about the exam itself