Courseiva

Salesforce Certified Platform Developer I (SALESFORCE-PD1) (SALESFORCE-PD1) — Questions 301375

493 questions total · 7pages · All types, answers revealed

Page 4

Page 5 of 7

Page 6
301
MCQmedium

A developer needs to retrieve Salesforce data in a Lightning Web Component without writing imperative Apex. Which module should be imported to use the wire service for standard record data?

A.lightning/platformShowErrorToast
B.lightning/navigation
C.lightning/uiRecordApi
D.lightning/apex
AnswerC

Contains wire adapters for standard record data manipulation.

Why this answer

lightning/uiRecordApi provides wire adapters to get, create, update, or delete record data.

302
MCQhard

An Apex trigger processes a list of Case records. The developer wants to group the cases by their AccountId. Which data structure is best suited for this grouping?

A.List<Map<Id, Case>>
B.Set<Map<Id, Case>>
C.Map<Id, Case>
D.Map<Id, List<Case>>
AnswerD

This structure supports multiple cases per AccountId.

Why this answer

A Map where the key is the AccountId (Id) and the value is a List of Cases (List<Case>) allows efficient grouping of child records by parent ID.

303
Multi-Selectmedium

Which THREE of the following items can be viewed in a debug log?

Select 3 answers
A.Database DML operations
B.Apex method execution
C.User login credentials
D.Browser cache contents
E.Workflow rule evaluation
AnswersA, B, E

DML activity is recorded.

Why this answer

Debug logs track database actions, Apex code, and workflow execution.

304
MCQmedium

A developer needs to query Task records related to Account records using a parent-to-child relationship. What is the standard child relationship name for Tasks on the Account object?

A.AccountTasks
B.ActivityHistories
C.ChildTasks
D.Tasks
AnswerD

Tasks is the standard child relationship name for task subqueries.

Why this answer

The standard child relationship name for Tasks on Account is OpenActivities and ActivityHistories or Tasks depending on the exact context, but Tasks is standard for custom/standard queries using Tasks relationship name.

305
MCQhard

A developer creates a Lightning Web Component that includes a third-party JavaScript library loaded via a Static Resource. In which lifecycle hook should the third-party library be initialized?

A.disconnectedCallback
B.connectedCallback
C.renderedCallback
D.constructor
AnswerB

Appropriate for initiating asynchronous operations like loading scripts.

Why this answer

Third-party scripts loaded via loadScript should be initialized in connectedCallback or renderedCallback, typically after successful promise resolution.

306
MCQmedium

A developer wants to schedule an Apex class to run daily. Which interface must the class implement?

A.Batchable
B.Schedulable
C.Callable
D.Queueable
AnswerB

Schedulable allows the execution of code at specific times.

Why this answer

The Schedulable interface is required for classes that need to be scheduled.

307
Multi-Selectmedium

Which THREE trigger context variables are available ONLY in insert and update triggers (not delete triggers)? (Choose THREE.)

Select 3 answers
A.Trigger.newMap
B.Trigger.new
C.Trigger.old
D.Trigger.isInsert and Trigger.isUpdate
E.Trigger.oldMap
AnswersA, B, D

Trigger.newMap is available on insert (after) and update.

Why this answer

Trigger.new, Trigger.newMap, and Trigger.oldMap are available in insert/update contexts (oldMap is update only, new/newMap are insert/update). Let's check exact availability: Trigger.new and Trigger.newMap are available on insert and update (and undelete for new). Trigger.old and Trigger.oldMap are available on update and delete.

Let's frame the question around variables available in Trigger insert/update events vs delete.

308
MCQmedium

A developer is building a Visualforce page that uses a custom controller and needs to display a message to the user when an error occurs. Which class and method should be used?

A.ApexPages.currentPage().getParameters().put()
B.ApexPages.addMessage()
C.Database.addError()
D.System.debug()
AnswerB

Adds a message object to the page messages queue.

Why this answer

ApexPages.addMessage() adds an ApexPages.Message to the page messages list.

309
Multi-Selectmedium

Which TWO statements are true regarding Queueable Apex compared to future methods? (Choose two.)

Select 2 answers
A.Queueable Apex returns an AsyncApexJob ID that can be used to monitor job progress.
B.Future methods support chaining multiple jobs sequentially.
C.Queueable Apex supports passing complex data types such as SObjects or custom objects.
D.Queueable Apex cannot perform HTTP callouts.
E.Queueable Apex methods must be annotated with @future.
AnswersA, C

Correct. System.enqueueJob returns an ID for tracking.

Why this answer

Queueable Apex offers job IDs for tracking and supports complex data types, unlike future methods.

310
Multi-Selecthard

Which THREE features are enforced when an Apex class is defined with the 'with sharing' keyword? Choose 3 options.

Select 3 answers
A.Profiles and Permission Sets
B.Field-Level Security
C.Sharing Rules
D.Organization-Wide Defaults
E.Role Hierarchies
AnswersC, D, E

Criteria and owner-based sharing rules are enforced.

Why this answer

with sharing enforces organization-wide defaults, role hierarchies, and sharing rules.

311
MCQhard

What is the maximum number of asynchronous Apex jobs that can be queued in a 24-hour period in a Developer Edition org?

A.250,000
B.1,000,000
C.10,000
D.100
AnswerA

250,000 is the correct limit for Developer Edition.

Why this answer

The limit is 250,000 asynchronous Apex method executions per 24-hour period.

312
Multi-Selectmedium

When should a developer choose to implement Schedulable Apex? (Choose two.)

Select 2 answers
A.To execute long-running batch processing or maintenance tasks periodically.
B.To respond instantly to record inserts or updates.
C.To handle immediate real-time user interface validation.
D.To perform synchronous HTTP callouts directly from a Lightning Component button.
E.To run an Apex job at specified time intervals using CRON expressions.
AnswersA, E

Correct. Schedulable Apex is commonly used to invoke batch jobs periodically.

Why this answer

Schedulable Apex is used to run Apex classes at scheduled times or intervals, such as nightly batch jobs or periodic maintenance tasks.

313
MCQeasy

Which annotation must be used on an Apex method to make it available for use with the @wire service in a Lightning Web Component?

A.@RemoteAction
B.@AuraEnabled(cacheable=true)
C.@InvocableMethod
D.@AuraEnabled
AnswerB

Required for wire service access.

Why this answer

Apex methods must be annotated with @AuraEnabled(cacheable=true) to be usable with @wire.

314
MCQhard

A developer has a requirement to perform a callout to an external ERP system immediately when an Opportunity reaches Closed Won. The developer decides to use a future method from an after update trigger. What is a primary architectural limitation of this approach?

A.Future methods cannot make callouts to external systems.
B.Future methods cannot accept sObject instances as parameters, requiring ID serialization/deserialization and additional SOQL queries.
C.Future methods execute synchronously in the same database transaction.
D.Future methods are limited to 1 callout per transaction.
AnswerB

Because future methods only accept primitives, the future method must requery records using passed IDs.

Why this answer

Future methods cannot accept sObjects as arguments, requiring the trigger to pass primitive IDs, and they cannot guarantee exact execution order when multiple asynchronous requests fire.

315
MCQeasy

Which component of the MVC design pattern in Salesforce Lightning Web Components (LWC) represents the data model and business logic layer?

A.Apex classes and database objects
B.HTML template files
C.CSS style sheets
D.JavaScript controller files
AnswerA

Apex classes, triggers, and standard/custom objects make up the Model.

Why this answer

In Salesforce, the Model layer corresponds to the database and Apex controllers/SOQL queries handling data.

316
MCQeasy

A developer is preparing to deploy metadata changes from a sandbox to a production org using Outbound Change Sets. Where must the administrator or developer establish the connection between the two organizations?

A.Connected Apps in the production org
B.Named Credentials in both orgs
C.Remote Site Settings in the source org
D.Deployment Settings in the target org
AnswerD

Inbound change sets require deployment connections to be authorized and deployed from trusted source orgs via Deployment Settings.

Why this answer

Deployment connections for change sets must be authorized and configured in Deployment Settings in the target production org.

317
MCQmedium

A developer is implementing a Lightning Web Component with a custom CSS file. How does the component load its associated stylesheet?

A.By declaring the stylesheet in the component's js-meta.xml configuration file.
B.By importing the CSS file explicitly at the top of the JavaScript file using an import statement.
C.Automatically by sharing the exact base file name in the same component bundle folder.
D.Using a <link rel="stylesheet"> tag inside the component HTML template.
AnswerC

Correct because LWC shadow DOM automatically bundles stylesheets sharing the component name.

Why this answer

LWC automatically loads a CSS file with the same name as the component JavaScript and HTML files if placed in the same bundle.

318
MCQhard

A developer writes an Apex method that executes a SOQL query inside a for-loop over a list of 200 Account records. Which governor limit is most likely to be immediately breached?

A.Total number of SOQL queries issued
B.Total heap size allocation
C.Maximum CPU time on Salesforce servers
D.Total number of records retrieved by SOQL queries
AnswerA

Executing a query inside a loop of 200 iterations results in 200 SOQL queries, exceeding the governor limit of 100.

Why this answer

The synchronous limit for SOQL queries is 100 per transaction. Querying inside a loop over 200 records will exceed this limit.

319
Multi-Selectmedium

Which TWO collections are valid in Apex and maintain the insertion order of their elements? Choose 2 answers.

Select 2 answers
A.TreeSet
B.Set
C.Map
D.List
E.Queue
AnswersC, D

Maps in Apex preserve the insertion order of their keys when iterated over.

Why this answer

Lists and Maps (specifically keeping insertion order for iteration) maintain insertion order, whereas standard sets do not guarantee order.

320
Multi-Selecthard

A developer is troubleshooting a Lightning Web Component where data retrieved via the @wire service needs to be formatted before being rendered in the template. Which THREE approaches are valid ways to handle or transform wired data? Choose 3 answers.

Select 3 answers
A.Directly mutate the object properties returned by the wire adapter inside the template.
B.Use a getter function that evaluates the wired property and returns the formatted result.
C.;Transform data within an Apex method before returning it to the wire service.
D.Use the renderedCallback() hook to modify the raw wired data object directly.
E.Use a wire adapter function (property-and-function syntax) to process data into a local reactive property.
AnswersB, C, E

Correct. Getters can derive formatted values reactively from wired properties.

Why this answer

Wired data can be handled via wired adapter property results using a getter, a wired function that transforms the value into a tracked local property, or custom wire adapters.

321
MCQmedium

A developer is analyzing a debug log and notices that it is truncated because it exceeded the maximum file size limit. Which action should the developer take to capture only the relevant Apex code execution details without exceeding the limit?

A.Increase the maximum log file size in company profile settings.
B.Adjust the Trace Flag log levels to reduce verbosity for unnecessary categories like Database and Workflow.
C.Disable all validation rules in the org temporarily.
D.Switch the debug log perspective to 'Development Harvester'.
AnswerB

Reducing verbosity for unneeded categories keeps log sizes small enough to capture the critical execution path.

Why this answer

Refining log categories and levels ensures only necessary debug statements are recorded, preventing truncation.

322
MCQmedium

A developer needs to convert a string variable containing an alphanumeric Salesforce ID into an ID primitive data type. Which approach is valid in Apex?

A.Id myId = String.toId(myString);
B.Id myId = Id.valueOf(myString);
C.Id myId = myString;
D.Id myId = Integer.valueOf(myString);
AnswerC

Strings containing valid 15-character or 18-character Salesforce IDs can be assigned directly to Id variables.

Why this answer

Passing a string to the Id constructor (Id myId = (Id)myString; or Id myId = myString;) automatically casts or converts valid string IDs to the Id type.

323
Multi-Selectmedium

Which TWO ways can a developer trigger a server-side Apex method imperatively from a Lightning Web Component? Choose 2 answers.

Select 2 answers
A.Import the Apex method as a JavaScript function from '@salesforce/apex/ClassName.methodName'.
B.Decorate the call with @wire in the JavaScript controller.
C.Call the method synchronously on the main thread.
D.Use standard form submission tags in HTML.
E.Invoke the imported function and handle the result using .then() and .catch() promise syntax.
AnswersA, E

Standard import syntax for Apex in LWC.

Why this answer

Imperative Apex calls return a Promise and are imported directly from the Apex class method.

324
MCQhard

A developer is creating a Lightning Web Component and needs to style a child component from a parent component across the shadow DOM boundary. What feature enables custom styling hooks?

A.Using CSS custom properties (variables) defined by the component.
B.Setting style attributes directly via JavaScript on child elements.
C.Using global CSS stylesheets
D.Using the >>> combinator selector
AnswerA

Styling hooks allow developers to style shadow DOM elements via CSS custom properties.

Why this answer

CSS custom properties (CSS variables) defined with --slds or custom component variables can pierce the shadow DOM if exposed.

325
MCQhard

An application has complex business logic where an Apex class called from a trigger needs to know whether it was invoked from an insert or update trigger context. How can the developer determine this?

A.Query the Audit Trail object for the active transaction ID.
B.Check Trigger.isInsert and Trigger.isUpdate boolean variables.
C.Check if Trigger.old is null; if null, it is always an update.
D.Inspect the exception stack trace using System.debug().
AnswerB

These context variables accurately reflect the trigger execution event.

Why this answer

Trigger.isInsert and Trigger.isUpdate context variables indicate whether the current trigger execution was caused by an insert or update operation.

326
MCQhard

A developer writes an Apex method with the 'inherited sharing' keyword. What is the behavior of this class when invoked from a class declared with 'with sharing'?

A.It throws a compilation error because sharing modes conflict.
B.It executes in system mode without enforcing sharing rules.
C.It enforces sharing rules because the calling class has 'with sharing'.
D.It prompts the user to select a sharing mode at runtime.
AnswerC

Inherited sharing adopts the context of the calling code.

Why this answer

Inherited sharing classes execute with sharing when invoked from a with sharing context, inheriting the caller's sharing rules.

327
MCQeasy

Which interface enables an Apex class to be invoked from a Flow using the InvocableAction framework?

A.Database.Batchable
B.Schedulable
C.Queueable
D.None, it uses the @InvocableMethod annotation.
AnswerD

Invocable actions are defined via the @InvocableMethod annotation rather than implementing a specific interface.

Why this answer

Methods annotated with @InvocableMethod allow Apex to be called from declarative flows.

328
MCQmedium

A developer writes a SOQL query to fetch Account records and wants to bind a list of strings called 'targetNames' as filter criteria. Which syntax is correct?

A.SELECT Id FROM Account WHERE Name IN targetNames
B.SELECT Id FROM Account WHERE Name IN {targetNames}
C.SELECT Id FROM Account WHERE Name IN STRING.valueOf(targetNames)
D.SELECT Id FROM Account WHERE Name IN :targetNames
AnswerD

The colon syntax (:targetNames) correctly binds the Apex collection variable to the query.

Why this answer

Using IN :targetNames allows binding a collection variable directly into a SOQL WHERE clause.

329
MCQmedium

What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?

A.To automate metadata deployment and package management.
B.To provide a visual interface for Change Sets.
C.To run unit tests manually.
D.To debug Apex in a GUI.
AnswerA

CLI facilitates source-driven development and automation.

Why this answer

The Salesforce CLI is the fundamental tool for programmatically interacting with Salesforce Orgs in automation.

330
MCQeasy

A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should the developer use?

A.constructor()
B.disconnectedCallback()
C.renderedCallback()
D.connectedCallback()
AnswerD

Correct because connectedCallback is called when the component is inserted into the DOM.

Why this answer

connectedCallback() is invoked when a component is inserted into the DOM, making it ideal for initialization logic that requires DOM readiness or wire adapters.

331
MCQmedium

An enterprise application requires real-time integration where outgoing callouts must be triggered from an Apex trigger. What architectural pattern must the developer use?

A.Batch Apex execute method without queueing.
B.Direct synchronous HTTP callout inside the before insert trigger.
C.Validation rule containing an endpoint URL.
D.Future method annotated with @future(callout=true) invoked from an after trigger.
AnswerD

Asynchronous future methods with callout=true allow web service requests from triggers safely.

Why this answer

Triggers cannot make direct synchronous callouts, so they must invoke an asynchronous mechanism like a future method with callout=true.

332
Multi-Selecthard

Which THREE actions are best practices when deploying Apex classes to production?

Select 3 answers
A.Run all tests in the destination organization.
B.Avoid using change sets.
C.Use version control to manage source code.
D.Directly edit classes in production.
E.Validate the deployment first without installing.
AnswersA, C, E

Ensures no regressions.

Why this answer

Running tests, validating, and using version control are key deployment practices.

333
MCQhard

A developer is implementing navigation in a Lightning Experience app using the NavigationMixin service in a Lightning Web Component. The developer wants to navigate to a standard ListView for the Account object. What is the correct type to specify?

A.type: 'standard__objectPage', attributes: { objectApiName: 'Account', actionName: 'list' }
B.type: 'standard__webPage', attributes: { url: '/lightning/o/Account/list' }
C.type: 'standard__recordPage', attributes: { objectApiName: 'Account', actionName: 'view' }
D.type: 'standard__namedPage', attributes: { pageName: 'accountList' }
AnswerA

Correct because objectPage with actionName list navigates to a standard object list view.

Why this answer

NavigationMixin.Navigate uses standard page references where type is 'standard__objectPage' and actionName is 'list'.

334
Multi-Selecthard

Which TWO of the following are valid ways to chain asynchronous Apex?

Select 2 answers
A.Calling a Queueable class from a constructor
B.Calling System.enqueueJob from within a Queueable class
C.Calling a @future method from within a @future method
D.Scheduling a new job from the finish method of a Batch Apex class
E.Calling Batch Apex from a formula field
AnswersB, D

This is the standard way to chain jobs.

Why this answer

Queueable Apex and Scheduled Apex allow for chaining or subsequent scheduling.

335
MCQhard

A developer is troubleshooting a Lightning Web Component where data returned from an Apex wire adapter needs to be mutated before being rendered. What is the correct pattern to handle this?

A.Decorate the wire property with @api mutable to allow direct writes.
B.Use the eval() function to strip immutability constraints from the prototype chain.
C.Create a shallow copy or clone of the wire data object in a getter or property assignment before mutation.
D.Directly assign new properties to the object returned by the wire adapter property.
AnswerC

Correct because cloning the immutable wire object allows modification.

Why this answer

Data returned by wire adapters is immutable (frozen). To mutate it, the developer must create a shallow copy of the data object.

336
MCQmedium

A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?

A.Deployment Status.
B.Apex Jobs.
C.Debug Logs.
D.System Overview.
AnswerB

Displays status for async jobs.

Why this answer

The Apex Jobs page lists all batch, future, and queueable jobs.

337
Multi-Selecteasy

Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)

Select 2 answers
A.Hardcode record IDs directly from the sandbox into assertions.
B.Create all required test data within the test method or test setup method.
C.Query production records directly in every assertion to verify live system status.
D.Use Test.startTest() and Test.stopTest() to isolate governor limits for the code being tested.
E.Use @isTest(SeeAllData=true) on all test classes to ensure maximum compatibility with production data.
AnswersB, D

Creating test data locally ensures test independence and reliability.

Why this answer

Using Test.startTest/stopTest and avoiding SeeAllData=true are essential Apex testing best practices.

338
MCQeasy

What is a 'Change Set' used for?

A.To migrate metadata between related Orgs.
B.To debug Apex code.
C.To backup user records.
D.To write Apex code.
AnswerA

Primary use case.

Why this answer

Change Sets move metadata between connected Salesforce Orgs.

339
Multi-Selectmedium

Which TWO types of triggers can be defined in Apex? Choose 2 options.

Select 2 answers
A.after trigger
B.instead of trigger
C.commit trigger
D.before trigger
E.validation trigger
AnswersA, D

After triggers execute after records are saved to the database.

Why this answer

Apex supports before triggers and after triggers executed around DML operations.

340
Multi-Selecthard

Which THREE of the following are valid uses for the Database.executeBatch method parameters?

Select 3 answers
A.Passing parameters to the constructor for configuration
B.Specifying the batch size
C.Specifying the instance of the batch class
D.Enabling the debug log
E.Setting the execution priority
AnswersA, B, C

The constructor is used for passing data.

Why this answer

The method allows setting the batch size, which is critical for performance tuning.

341
Multi-Selecthard

Which THREE limitations apply to @future methods?

Select 3 answers
A.Cannot pass SObjects as arguments
B.Cannot be used in a test class
C.Cannot be used in a Batch Apex class
D.Cannot track the execution status via an ID
E.Cannot be called from another @future method
AnswersA, D, E

Only primitives are allowed.

Why this answer

Future methods cannot be tracked, have specific parameter limits, and cannot be chained.

342
MCQeasy

Which SOQL query utilizes the correct syntax to retrieve child Contact records from a parent Account record using the standard relationship name?

A.SELECT Id, (SELECT Id FROM Contact__r) FROM Account
B.SELECT Id, (SELECT Id FROM Account.Contacts) FROM Account
C.SELECT Id, (SELECT Id FROM Contact) FROM Account
D.SELECT Id, (SELECT Id FROM Contacts) FROM Account
AnswerD

Contacts is the correct standard child relationship name for Account-to-Contact queries.

Why this answer

Standard child relationships use the pluralized object name with '__r' for custom or standard naming conventions (e.g., Contacts).

343
MCQhard

A Queueable Apex job implements Database.AllowsCallouts and chains another Queueable job. What is the maximum number of jobs that can be chained in a single transaction chain?

A.Unlimited
B.5
C.1
D.50
AnswerB

In developer and enterprise editions, the maximum chain depth for Queueable jobs is 5.

Why this answer

Queueable jobs can be chained, but only one child job can be spawned per execution, up to a maximum depth limit of 5 in a synchronous transaction chain (or more depending on async chains, but standard chaining depth is limited).

344
Multi-Selecthard

Which THREE features are supported in Salesforce scratch orgs? (Choose three.)

Select 3 answers
A.Installing unlocked and managed packages for testing.
B.Permanent production status with unlimited user licenses.
C.Source tracking between the local project and the scratch org.
D.Directly modifying standard Salesforce platform source code.
E.Configuring edition, features, and settings via a project-scratch-def.json file.
AnswersA, C, E

Packages can be installed into scratch orgs for testing dependencies.

Why this answer

Scratch orgs support source tracking, custom configurations, and feature activation.

345
MCQeasy

What is the correct file extension for a Lightning Web Component HTML template file?

A..vfp
B..page
C..html
D..cmp
AnswerC

Standard extension for LWC templates.

Why this answer

LWC HTML template files must use the .html extension and share the component base name.

346
MCQhard

A developer is writing a Queueable class that needs to make a callout and also perform a DML operation afterward in the same transaction. Which interface must be added to the Queueable class definition?

A.Schedulable
B.Database.Batchable<SObject>
C.Database.AllowsCallouts
D.InstallHandler
AnswerC

Implementing Database.AllowsCallouts permits HTTP callouts from asynchronous Queueable executions.

Why this answer

To make HTTP callouts in Queueable Apex, the class must implement the Database.AllowsCallouts interface.

347
MCQhard

A developer creates an Apex trigger that updates related Contact records whenever an Account record is updated. The trigger performs a DML operation on the Contacts. During testing, updating an Account causes the trigger to fire infinitely and throw a System.LimitException: Maximum trigger depth exceeded. Which design pattern should the developer implement to prevent this recursion?

A.Use a Database.setSavepoint() before the DML operation to rollback if recursion occurs.
B.Convert the trigger logic into a Queueable Apex job to defer execution to a separate transaction.
C.Use a static boolean flag in a helper class to ensure the trigger block executes only once per transaction.
D.Check Trigger.isExecuting to determine if the trigger is running in a recursive context.
AnswerC

Correct. A static variable retains its value for the duration of the request, allowing the code to check if it has already executed.

Why this answer

Using a static boolean flag in a helper class is the standard Salesforce pattern to prevent recursive trigger execution by tracking whether the trigger logic has already run in the current transaction.

348
MCQhard

A developer is configuring a Lightning Web Component that uses the Lightning Message Service (LMS). Which module must be imported to publish a message on a message channel?

A.lightning/uiRecordApi
B.lightning/empApi
C.lightning/navigation
D.lightning/messageService
AnswerD

Provides publish, subscribe, and release functions for LMS.

Why this answer

publish function and the message channel reference are imported from lightning/messageService and the channel definition file respectively.

349
Multi-Selecthard

Which THREE statements are accurate regarding Apex transaction control and database savepoints? Choose 3 answers.

Select 3 answers
A.Database.setSavepoint() returns a Savepoint object reference.
B.Establishing a savepoint resets the SOQL query governor limit counter.
C.Rolling back to a savepoint clears all governor limit exceptions already thrown.
D.You can set multiple savepoints within a single transaction.
E.Savepoints allow developers to roll back part of a transaction after encountering errors.
AnswersA, D, E

Database.setSavepoint() creates and returns a Savepoint token.

Why this answer

Savepoints allow partial rollbacks within a single transaction using Database.setSavepoint() and Database.rollback().

350
MCQmedium

A developer writes a SOQL query using the FORMAT() keyword. What is the purpose of this keyword?

A.To ensure SOQL query syntax is validated before execution
B.To return number, date, and currency fields formatted according to the user's locale
C.To format query results into JSON format
D.To convert string fields into uppercase
AnswerB

FORMAT() applies localized formatting to numeric, date, and currency fields.

Why this answer

FORMAT() formats currency, date, time, and numerical fields according to the current user's locale settings.

351
MCQmedium

A developer needs to ensure that an Apex trigger fires only during the after insert context. Which check should be placed at the beginning of the trigger body?

A.if (Trigger.size > 0)
B.if (Trigger.isExecuting)
C.if (Trigger.isBefore && Trigger.isUpdate)
D.if (Trigger.isAfter && Trigger.isInsert)
AnswerD

This condition correctly targets after insert events.

Why this answer

Checking Trigger.isAfter and Trigger.isInsert ensures the code runs only during the desired trigger event.

352
Multi-Selecthard

Which THREE actions should a developer take to optimize Visualforce view state performance? Choose 3 answers.

Select 3 answers
A.Store sObjects in public static variables.
B.Query only the fields needed in the page rather than entire sObjects.
C.Mark member variables that do not need to be preserved across postbacks as transient.
D.Store large lists of static data in controller member variables.
E.Minimize the number of form components and controller state variables.
AnswersB, C, E

Reduces object size in view state.

Why this answer

To optimize view state, developers should use the transient keyword, minimize controller sObject queries/fields, and use custom wrapper classes where appropriate.

353
Multi-Selectmedium

Which TWO of the following are valid ways to specify which tests to run in the Salesforce CLI?

Select 2 answers
A.sfdx force:apex:test:run -c
B.sfdx force:apex:test:run -s
C.sfdx force:apex:test:run -f
D.sfdx force:apex:test:run -n MyTestClass
E.sfdx force:apex:test:run -u
AnswersA, D

Using -c runs all tests in the package.

Why this answer

The CLI allows running specific classes or classes within a namespace.

354
MCQmedium

A developer is writing a Visualforce page with custom controller logic and needs to ensure that database operations are executed transactionally. What happens by default when an unhandled exception occurs during a controller action method?

A.The entire transaction is rolled back.
B.The user is redirected to the login page.
C.Only partial records are saved; successful ones are committed.
D.Changes are committed and an email is sent to the admin.
AnswerA

Salesforce transactions are atomic; unhandled exceptions cause a full rollback.

Why this answer

All database changes in the transaction are rolled back automatically by the platform if an unhandled exception occurs.

355
MCQmedium

A developer is building a Lightning Web Component that needs to fetch records imperatively based on a user interaction. Which Lightning module should the developer import to access Salesforce data imperatively in JavaScript?

A.lightning/platformResourceLoader
B.@salesforce/schema
C.@salesforce/apex
D.lightning/uiRecordApi
AnswerC

Correct. The @salesforce/apex module allows importing Apex methods for imperative calls.

Why this answer

To call Apex methods imperatively in a Lightning Web Component, developers must import the method from the @salesforce/apex scoped module.

356
MCQmedium

A developer has a requirement to update child Case records whenever a parent Account's status changes. The logic requires complex looping, exception handling, and handling up to 10,000 related records. Which tool should the developer choose according to Salesforce best practices?

A.Workflow Rule
B.Record-Triggered Flow
C.Apex Trigger
D.Process Builder
AnswerC

Apex triggers provide robust control, bulkification, and error-handling capabilities for complex enterprise logic.

Why this answer

Apex Triggers combined with Batch Apex or bulkified code are ideal for complex business logic involving high-volume child record updates that exceed declarative flow limits.

357
MCQmedium

A developer needs to measure the performance of a SOQL query. Which log category and level should be used?

A.Database: INFO.
B.System: DEBUG.
C.Apex Code: INFO.
D.Profiling: FINEST.
AnswerA

Captures query performance.

Why this answer

The Database category at the INFO level or higher captures SOQL execution metrics.

358
Multi-Selecthard

A developer needs to write a secure SOQL query that prevents unauthorized data exposure by respecting both sharing rules and field-level security. Which TWO approaches can the developer combine to achieve this? (Choose two.)

Select 2 answers
A.Include the 'WITH SECURITY_ENFORCED' clause in the SOQL query.
B.Disable FLS checks in user profile settings before executing queries.
C.Execute queries inside an asynchronous @future method.
D.Use the 'without sharing' keyword on all transaction controllers.
E.Define the helper class with the 'with sharing' keyword.
AnswersA, E

WITH SECURITY_ENFORCED enforces field and object-level security checks on SOQL queries.

Why this answer

Sharing rules are enforced via class keywords, while FLS can be enforced using WITH SECURITY_ENFORCED or Security.stripInaccessible.

359
MCQmedium

A developer has a Lightning Web Component with a reactive property 'recordId'. How should the property be decorated to ensure it receives the current record ID when placed on a record page?

A.@wire recordId;
B.@track recordId;
C.@wire(getRecord) recordId;
D.@api recordId;
AnswerD

@api exposes the property so Salesforce can inject the record ID.

Why this answer

@api makes properties public so the container can pass values like recordId into the component.

360
Multi-Selectmedium

Which TWO tools are effective for monitoring asynchronous Apex jobs?

Select 2 answers
A.Setup > Security
B.Setup > Debug Logs
C.Setup > Apex Jobs
D.Querying the AsyncApexJob object
E.Setup > Flows
AnswersC, D

This shows all async jobs.

Why this answer

The Apex Jobs page and the AsyncApexJob object are primary monitoring tools.

361
MCQeasy

A developer wants to include a custom styling hook to override a standard Lightning Design System component token in a Lightning Web Component. Where should this CSS custom property be defined?

A.Inside the component controller JavaScript file (.js)
B.In the component's cascading style sheet file (.css)
C.In a separate Static Resource uploaded to Salesforce
D.In the component's configuration file (.js-meta.xml)
AnswerB

Correct. SLDS styling hooks are defined inside the component's CSS file.

Why this answer

Custom properties to override SLDS tokens should be defined in the component's style sheet (.css file) targeting the component's host or matching elements.

362
Multi-Selecthard

Which TWO of the following are required to successfully use the 'Test.startTest()' and 'Test.stopTest()' pattern for testing batch Apex?

Select 2 answers
A.The batch class must be implemented in a separate file
B.The test must be annotated with @isTest(SeeAllData=true)
C.The batch class must have a global access modifier
D.Assertions must be placed after the Test.stopTest() call
E.Database.executeBatch must be called between the start and stop methods
AnswersD, E

Assertions must wait until the asynchronous work is processed by stopTest.

Why this answer

This pattern is required to force the batch to execute within the test context and ensure it completes before assertions.

363
MCQeasy

Which SLDS grid class should be used to create a flexible container where items wrap automatically onto multiple rows?

A.slds-wrap
B.slds-col
C.slds-nowrap
D.slds-grid
AnswerA

Allows grid items to wrap to multiple lines.

Why this answer

slds-wrap enables wrapping in SLDS flexbox grids.

364
MCQhard

An application has a requirement to query records owned by subordinate users in the role hierarchy using Apex. Which SOQL feature supports this capability?

A.SELECT Hierarchy FROM User
B.Executing queries in 'with sharing' context where sharing rules grant access via role hierarchy
C.USING SCOPE subordinate
D.WITH ROLE HIERARCHY
AnswerB

Record visibility down the role hierarchy is automatically enforced by Salesforce sharing rules when queries run in 'with sharing' mode.

Why this answer

The WITH DATA CATEGORY or parent user hierarchy queries can be accomplished using standard sharing, but for role hierarchy expansions in SOQL, developers use keyword qualifiers or UserRecordAccess. Wait, standard SOQL does not have a direct 'ROLE HIERARCHY' keyword, but SOSL/SOQL supports user permission checks, or specifically, sharing rules are evaluated automatically in 'with sharing' classes. However, querying subordinate data is managed by sharing rules and record ownership.

365
MCQeasy

Which best practice should be followed when writing Apex triggers to ensure bulkification?

A.Always query inside a for loop for every record.
B.Design triggers to process collections of records in bulk using collections and bulk SOQL queries.
C.Use future methods for every trigger execution.
D.Hardcode record IDs in trigger logic for performance.
AnswerB

Bulkification ensures that triggers handle any number of records passed via data loader or UI seamlessly.

Why this answer

Triggers must be written to handle collections of records (Trigger.new / Trigger.old) rather than single records.

366
MCQhard

During the Salesforce save order of execution, when are before triggers executed relative to custom validation rules?

A.Before triggers execute after custom validation rules.
B.Before triggers execute after the record is committed to the database.
C.Before triggers execute before custom validation rules.
D.Before triggers execute concurrently with custom validation rules.
AnswerC

Before triggers run prior to validation rules so values can be normalized or prepopulated.

Why this answer

Before triggers execute before custom validation rules are evaluated, allowing developers to modify field values before validation checks run.

367
MCQeasy

A developer needs to ensure that a specific Apex method runs asynchronously because it makes a callout to an external REST API from a standard user interface controller. Which annotation must be added to the method?

A.@ReadOnly
B.@InvocableMethod
C.@future(callout=true)
D.@AuraEnabled(callout=true)
AnswerC

Correct. The @future annotation with callout=true enables asynchronous execution and allows callouts.

Why this answer

The @future(callout=true) annotation allows an Apex method to run asynchronously and enables it to perform HTTP callouts.

368
Multi-Selecthard

Which THREE statements are true regarding asynchronous Apex governor limits and execution behavior? (Choose three.)

Select 3 answers
A.Asynchronous Apex jobs execute in their own separate transaction with independent governor limits.
B.Future methods can be chained indefinitely without any depth limitations.
C.Queueable Apex jobs return an AsyncApexJob ID that can be queried to track job progress and status.
D.Batch Apex jobs cannot make external web service callouts.
E.Asynchronous Apex transactions have a higher CPU time limit of 60,000 milliseconds compared to synchronous transactions.
AnswersA, C, E

Each asynchronous execution runs in a fresh transaction with reset limits.

Why this answer

Asynchronous jobs have higher limits (heap, CPU time), run in separate transactions, and can be monitored via AsyncApexJob.

369
MCQhard

A developer has a trigger that updates related child records. To prevent recursive trigger execution when updates ripple through child triggers, what is a standard best practice design pattern?

A.Using Flow Builder instead of Apex triggers for all child records.
B.Disabling all triggers via Custom Settings permanently.
C.Using a static boolean flag in a utility class to track execution state.
D.Wrapping every DML statement in a try-catch block.
AnswerC

A static boolean flag set to true after first execution prevents subsequent recursive triggers from running.

Why this answer

Using a static boolean flag in a helper class is the classic pattern to prevent recursive trigger execution in Salesforce.

370
Multi-Selectmedium

Which THREE pieces of information are displayed in the Apex Test Execution page?

Select 3 answers
A.Code Coverage Percentage.
B.Execution Status.
C.Test Class Name.
D.Execution Time.
E.User who initiated the test.
AnswersB, C, D

Shows pass/fail.

Why this answer

The page shows class name, status, and duration.

371
MCQeasy

What is the maximum number of view state bytes allowed in a Visualforce page before Salesforce throws an error?

A.1 MB
B.172 KB
C.64 KB
D.512 KB
AnswerB

Standard Salesforce view state limit.

Why this answer

The maximum view state limit for a Visualforce page is 172 KB.

372
Multi-Selecthard

A developer is troubleshooting a transaction that exceeds governor limits due to SOQL queries. Which THREE techniques help prevent hitting SOQL query limits in Apex? (Choose THREE.)

Select 3 answers
A.Using maps and collections to store query results and perform in-memory lookups instead of querying inside loops.
B.Writing queries that retrieve only the specific fields and records required using WHERE clauses.
C.Using relationship queries (parent-to-child or child-to-parent) to retrieve related data in a single query.
D.Executing SOQL queries inside a for loop iterating over all child records.
E.Calling Database.query() for every single record processed in a trigger.
AnswersA, B, C

In-memory map lookups eliminate repetitive SOQL queries inside loops.

Why this answer

Avoiding queries in loops, using aggregate queries, and caching results in maps/collections help avoid SOQL query limit issues.

373
Multi-Selectmedium

Which TWO techniques can be used to pass data from a parent component to a child Lightning Web Component? Choose 2 answers.

Select 2 answers
A.Using application events via $A.get('e...')
B.Calling public @api methods defined on the child component instance from the parent JavaScript.
C.Directly modifying child private properties using DOM queries.
D.Using global window variables.
E.Binding properties to public @api properties on the child component in the parent template.
AnswersB, E

Allows imperative data passing or action invocation.

Why this answer

Data is passed down via public properties decorated with @api or by invoking public child methods.

374
MCQhard

A developer implements a Schedulable class to run a daily cleanup job. What is the maximum number of scheduled Apex jobs that can be simultaneously active in an org?

A.500
B.50
C.100
D.250
AnswerC

Salesforce limits the number of scheduled Apex jobs in an org to 100.

Why this answer

Salesforce enforces a strict limit of 100 simultaneous scheduled Apex jobs per org.

375
MCQhard

An Apex trigger executes a query inside a for-loop to fetch related child records for every parent Account in Trigger.new. The developer notices that when a data load of 200 accounts occurs, the governor limit for total SOQL queries issued is exceeded. How should the developer refactor the code?

A.Annotate the trigger with @ReadOnly to increase the query limit.
B.Wrap the query in a try-catch block and catch the QueryException.
C.Use the Database.executeBatch method to process each account in a separate transaction.
D.Collect the Account IDs in a Set and execute a single SOQL query outside the loop using the IN operator.
AnswerD

Bulkification requires gathering IDs into a collection and executing a single query outside of loops.

Why this answer

To avoid hitting the governor limit of 100 SOQL queries per transaction, queries must be moved outside of loops and bulkified using collections.

Page 4

Page 5 of 7

Page 6

All pages