Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Salesforce Build Applications Programmatically on the Salesforce Platform DEX-450 Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 14 Total 201 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Apex Coding

Skill tested: Apply bulk-processing patterns and governor-limit awareness when writing Apex.

A service team imports up to 200 Case records in one transaction. For each Case, an Apex routine must find matching entitlement records and update a related Account summary. The existing implementation queries inside a loop and performs one update per Case; it works for small batches but intermittently exceeds transaction limits during imports. The business requires the same results for single-record edits and bulk loads, and the routine must not rely on asynchronous processing. Which redesign is most appropriate?

Correct Answer: D. Collect Case and Account identifiers, query the required records in bulk, calculate changes in memory, and perform a bulk update outside the loop.
Explanation:

Apex governor limits apply to the whole transaction, so the routine should avoid database operations inside record-processing loops. Collecting identifiers, issuing a bounded set of bulk queries, calculating results in memory, and issuing bulk DML reduces the number of SOQL and DML statements while supporting trigger-sized batches. Catching a limit exception does not make an exhausted limit usable again. SOSL is not a substitute for relationship and entitlement queries, and recursive subdivision still consumes the same transaction-wide limits.

Question 2

New Multiple answers

Topic: Org Data Retrieval Using SOQL & SOSL

Skill tested: Construct relationship SOQL and process queried parent-child records efficiently.

A sales operations team needs a report generated by Apex for Accounts in a specified region. For each matching Account, the report must include its name and the names and stages of related Opportunities. The result must be built with one database query, must include Accounts even when they have no Opportunities, and must not issue a query for each Account. Which two approaches meet these requirements? Select two.

Correct Answer: C. Use a parent-to-child relationship subquery for Opportunities and process the returned child collection for each Account.; E. Use a parent-to-child SOQL relationship query from Account and iterate each Account's Opportunities child collection.
Explanation:

A parent-to-child relationship query can return Accounts and their related Opportunities in one SOQL statement. Because the query starts from Account, Accounts with no matching child records remain in the result with an empty child collection, satisfying the inclusion requirement. Iterating the returned collection avoids per-Account queries. An Opportunity-rooted query cannot return Accounts that have no Opportunities, while querying inside a loop risks exceeding SOQL limits. SOSL is intended for text search and does not provide the requested typed relationship result structure.

Question 3

New Single answer

Topic: Org Data Manipulation Using DML

Skill tested: Choose partial-success DML and inspect row-level errors without aborting all records.

A nightly Apex job updates a list of independently processed Contact records. A validation rule may reject some records, but the business owner requires valid Contacts to be saved even when other records fail. The job must also capture the failed record identifiers and error messages for later review. Which implementation best meets these requirements?

Correct Answer: A. Call Database.update(records, false), inspect each SaveResult, and associate failed results with the corresponding input records.
Explanation:

Database.update with allOrNone set to false allows successful rows to be saved while failed rows return errors in their corresponding SaveResult entries. The code can inspect each result's success status and errors, then associate failures with the input records by list position. A standard all-or-none update rolls back the operation when a row fails. Database methods do not automatically imply partial success, and individual DML in a loop is inefficient and makes it harder to manage limits and results.

Question 4

New Single answer

Topic: Deployment

Skill tested: Select a Salesforce deployment mechanism based on org relationships and release needs.

A development team maintains a shared set of metadata for several customer-specific Salesforce orgs. The team wants version-controlled releases, repeatable deployment through a command-line workflow, and the ability to install the same package into multiple orgs. The orgs are not connected by a change-set deployment relationship, and the team needs to deliver managed-package functionality. Which approach is most suitable?

Correct Answer: C. Create a managed package and use Salesforce CLI package and installation workflows for versioned delivery.
Explanation:

A managed package supports versioned distribution of packaged functionality to multiple subscriber orgs, and Salesforce CLI workflows support creating and installing package versions as part of a repeatable development process. Change sets require an appropriate deployment connection and are not a general cross-customer distribution mechanism. Source tracking helps manage development source but is not itself a deployable package. Unmanaged packages do not provide the managed-package upgrade and ownership model described.

Question 5

New Single answer

Topic: Apex Trigger Essentials

Skill tested: Use trigger context variables to implement bulk-safe before-update validation.

A company has a custom Subscription object with a before-update trigger. Users may change a subscription's status only when its end date is not earlier than its start date. Imports can update hundreds of subscriptions at once. Invalid records must be rejected with a useful message while valid records in the same operation remain eligible to save. Which trigger implementation is most appropriate?

Correct Answer: C. In a before-update trigger, compare each record's dates and call addError on each invalid Trigger.new record.
Explanation:

A before-update trigger can validate incoming values before the records are saved. Calling addError on an individual Trigger.new record prevents that record from being saved and provides a message, while allowing other records in the bulk operation to proceed where applicable. An after trigger is too late for this validation pattern, and issuing corrective updates risks recursion and unnecessary DML. A query is not needed because both date values are already available in the trigger records.

Question 6

New Single answer

Topic: Apex Class Essentials

Skill tested: Apply Apex class sharing declarations to enforce record-level sharing behavior.

An Apex controller is called by a Lightning page used by sales representatives. The controller reads Account records and returns selected fields to the page. Representatives must see only records they can access through Salesforce record-level sharing. The controller does not perform administrative work, and the team wants its access behavior to be explicit rather than dependent on an unspecified class default. Which declaration should the controller use?

Correct Answer: C. Declare the class with `with sharing` so record-level sharing is enforced for its execution.
Explanation:

Declaring the controller `with sharing` makes its record-level sharing behavior explicit and appropriate for data returned to sales representatives. `without sharing` can expose records beyond the user's sharing access. `global` controls visibility of an Apex class across namespaces and does not enforce sharing. `@AuraEnabled` exposes eligible methods to Lightning clients but is not a sharing declaration; it does not replace a deliberate sharing model.

Question 7

New Multiple answers

Topic: Order of Execution, Apex Transactions, & Platform Events

Skill tested: Configure platform-event publishing behavior for durable transaction-independent error logging.

An organization records integration failures by publishing a custom platform event from Apex. The failure occurs during a transaction that is later rolled back. Administrators still need the error event to be published so monitoring can capture the failure independently of the business-data rollback. The logging design must not make the event part of the failed transaction's commit decision. Which two actions are appropriate? Select two.

Correct Answer: A. Configure the custom platform event's publish behavior as Publish Immediately.; C. Publish the event using the Apex EventBus publishing method and handle the publish result as appropriate.
Explanation:

A platform event configured for Publish Immediately is published when the publish operation occurs rather than waiting for the enclosing transaction to commit, so it can support logging even when that transaction rolls back. Apex publishes platform events through EventBus methods, whose results should be considered by the implementation. Publish After Commit would suppress publication if the transaction does not commit. Ordinary event DML is not the publishing mechanism, and an after-commit trigger cannot run for a rolled-back transaction.

Question 8

New Single answer

Topic: Apex Testing

Skill tested: Create isolated Apex test data and assert behavior without relying on org records.

A team is adding tests for an Apex service that calculates a discount from custom Price Rule records. The service must be tested in a deployment org where no matching production data is guaranteed, and test execution should remain repeatable as administrators change org records. The test must verify both the calculated value and the behavior when no rule applies. Which approach is best?

Correct Answer: A. Create the required Price Rule records in the test, invoke the service for matching and nonmatching scenarios, and assert the returned results.
Explanation:

Apex tests should create the data needed for their scenarios rather than depend on mutable org records. Creating explicit rule data makes the test isolated and repeatable, and exercising both a match and no-match case verifies the service's intended behavior. Querying existing data can fail in another org or change when administrators edit records. `SeeAllData=true` weakens isolation, while merely asserting that no exception occurs does not validate the calculated result.

Question 9

New Multiple answers

Topic: Design Strategies for Efficient Apex Solutions

Skill tested: Design bulk-safe trigger logic with consolidated queries and DML operations.

A custom Invoice trigger recalculates related Customer totals whenever invoices are inserted or updated. Bulk imports can contain up to 200 invoices, and a customer can appear on several invoices in one transaction. The total must reflect all affected invoices, and the trigger must stay within transaction limits. Which two design decisions are appropriate? Select two.

Correct Answer: A. Aggregate the new totals by Customer ID in memory, then perform one bulk update for the affected Customer records.; B. Collect distinct Customer IDs from the trigger records and query the required customer and invoice data in a bounded query outside record loops.
Explanation:

Bulk-safe trigger logic gathers affected identifiers, performs queries outside loops, and consolidates updates by related Customer. Aggregating calculations by Customer ID ensures that multiple changed invoices for one Customer contribute to a single final total and allows one bulk DML operation. Updating inside the loop or querying per invoice consumes limits and can produce redundant work. A blanket static Boolean can incorrectly suppress legitimate later trigger invocations rather than handling recursion or processing state precisely.

Question 10

New Single answer

Topic: Apex Trigger Design Strategies

Skill tested: Use declarative automation for field updates and reserve Apex for logic requiring code.

When an Opportunity changes to Closed Won, a business wants to set a checkbox on its related Account. The rule is deterministic, uses fields already available through the relationship, and does not require complex calculations, external calls, or custom error handling. Administrators must be able to maintain the rule, and the organization wants to minimize custom code and trigger interactions. What is the best approach?

Correct Answer: A. Create a record-triggered Flow on Opportunity that updates the related Account when the stated condition is met.
Explanation:

A record-triggered Flow is suitable for straightforward conditional automation that updates a related record, and it remains maintainable by administrators. It avoids custom Apex for logic that does not require code-specific capabilities. A trigger adds unnecessary implementation and bulk-handling responsibilities; a scheduled scan delays the update and processes more data than needed. A validation rule can block or validate a record save but cannot update the related Account field.