Salesforce-Platform-Developer Practice Test

Salesforce Spring 25 Release -
Updated On 18-Sep-2025

237 Questions

Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers

A. $Lightning.createComponent

B. < apex:slds > < /apex:slds>

C. $Lightning.useComponent

D. $Lightning.use

E. < apex : includeLightning / >

A.   $Lightning.createComponent
D.   $Lightning.use
E.   < apex : includeLightning / >

Explanation:

To embed a Lightning component on a Visualforce page, Salesforce provides the $Lightning global object and some required Visualforce tags.

A. $Lightning.createComponent Used to dynamically create and insert the Lightning component into the Visualforce page.

D. $Lightning.use Initializes the Lightning runtime and specifies which Lightning component bundle to use. It's required before calling createComponent.

E. This tag loads the Lightning runtime into the Visualforce page—necessary to support $Lightning.

Incorrect Options:

B. < apex : slds >
This is used to include SLDS styles, not required to embed a Lightning component.

C. $Lightning.useComponent
Not a real method — invalid in the Lightning global object.

For which three items can 2 trace flag be configured? Choose 3 answers

A. Flow

B. Apex Class

C. User

D. Apex Trager

E. Visualforce

B.   Apex Class
C.   User
D.   Apex Trager

Explanation:

A trace flag in Salesforce is used to capture detailed logs for debugging Apex code execution. Developers configure trace flags for specific entities to monitor their execution in the Developer Console.

Why these answers are correct?

B. Apex Class ✅ Trace flags can be set on specific Apex classes to monitor code execution and identify issues within the class logic.

C. User ✅ Trace flags can be set for a specific user, capturing all Apex executions for that user session, including triggers, workflows, and Visualforce transactions.

D. Apex Trigger ✅ Since triggers execute before or after DML operations, setting a trace flag on an Apex trigger helps monitor its behavior and debug execution flow.

Reviewing incorrect choices:

A. Flow – While Flow debug logs exist, Flow execution is not captured using Apex trace flags. Debugging Flows requires activating debug mode within Flow settings.
E. Visualforce – While Apex executed within Visualforce pages can be traced, Visualforce itself does not have trace flags.

Which two characteristics are true for Lightning Web Component custom events? Choose 2 answers

A. Data may be passed In the payload of a custom event using a wire decorated properties.

B. By default a custom event only propagates to its immediate container and to its immediate child component.

C. By default a custom event only propagates to it's immediate container.

D. Data may be passed in the payload of a custom event using a property called detail.

C.   By default a custom event only propagates to it's immediate container.
D.   Data may be passed in the payload of a custom event using a property called detail.

Explanation:

Lightning Web Components (LWC) use custom events for communication between components, especially from child to parent. Here’s what’s true:

C. By default a custom event only propagates to its immediate container.
Custom events in LWC do not bubble beyond the immediate parent unless the event is explicitly configured with bubbles: true.

D. Data may be passed in the payload of a custom event using a property called detail. To pass data in a custom event, you use the detail property:

this.dispatchEvent(new CustomEvent('myevent', { detail: { value: 'something' } }));

Why the other options are incorrect:

A. Data may be passed in the payload using wire-decorated properties
@wire is for data retrieval, not for event communication. Custom events don't use @wire for passing data.

B. Custom event propagates to both immediate container and child
Custom events propagate upward (to containers), not downward to child components.

A developer creates a batch Apex job to update a large number of records, and receives reports of the job timing out and not completing. What is the first step towards troubleshooting the issue?

A. Check the asynchronous job monitoring page to view the job status and logs.

B. Check the debug logs for the batch job.

C. Decrease the batch size to reduce the load on the system.

D. Disable the batch job and recreate it with a smaller number of records.

A.   Check the asynchronous job monitoring page to view the job status and logs.

Explanation:

When a batch Apex job is timing out or not completing, the first step in troubleshooting is to check the Asynchronous Jobs monitoring page in Salesforce Setup. This will show:

The status of the job (e.g., Completed, Failed, Aborted)
Error messages, if any
Start/end times
Number of records processed

This helps you understand where and why the failure is occurring before taking further action.

Which scenario is valid for execution by unit tests?

A. Load data from a remote site with a callout.

B. Set the created date of a record using a system method.

C. Execute anonymous Apex as a different user.

D. Generate a Visualforce PDF with geccontentAsPDF ().

B.   Set the created date of a record using a system method.

Explanation:

Why B is Valid?

In unit tests, you can use Test.setCreatedDate(recordId, datetime) to backdate records for testing (e.g., validating time-based logic).
This is a test-specific system method and works only in test context. Why Others Are Invalid?

A. Load data from a remote site with a callout.
Callouts are blocked in tests unless mocked. Use Test.setMock() to simulate responses.

C. Execute anonymous Apex as a different user.
Anonymous Apex cannot run in tests (use System.runAs() instead to switch users).

D. Generate a Visualforce PDF with getContentAsPDF().
getContentAsPDF() is not supported in tests (it requires a visual render, which tests don’t execute).

Salesforce-Platform-Developer Exam Questions - Home
Page 2 out of 48 Pages