Limited-Time Offer: Enjoy 50% Savings! Ends in 00h 00m 00s Coupon code: 50OFF
Skip to content

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

Page: 1 / 14 Total 201 questions

Want more questions? Get Premium Access.

Question 1

What are two benefits of using External IDs?

Choose 2 answers

Correct Answer: A. An External ID field can be used to reference an ID from another external system.; D. An External 1D is indexed and can improve the performance of SOOL queries.

Question 2

A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat:

ist performSearch (String lastName} [

return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like

s'+lastName+'s'")?;

What are two ways the developer can update the method to prevent a SOQL injection attack?

Choose 2 answers

Correct Answer: C. Use the Readonly annotation and the with sharing keyword on the class.; D. Use a regular expression on the parameter to remove special characters.

Question 3

A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debitAmount' should not be able to change once a value is assigned.

In which two ways can the developer declare the variables to ensure their value can only be assigned one time?

Choose 2 answers

Correct Answer: B. Use the final keyword and assign its value in the class constructor.; C. Use the final keyword and assign its value when declaring the variable.

Question 4

Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.

The component should be able to validate the user input before saving the information to the database.

What is the best technology to create this component?

Correct Answer: B. Lightning Web Components

Question 5

Which two statements are true about using the @testSetup annotation in an Apex test class?

Choose 2 answers

Correct Answer: B, B, D

Question 6

A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.

What two things should be done to create the test data within the unit test with the least amount of code?

Choose 2 answers

Correct Answer: C. Create a static resource containing test data.; D. Use Test, loadData to populate data in your test methods.

Question 7

Assuming that name is a String obtained by an tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection? Choose 2 answers

A)

B)

C)

D)

Correct Answer: A. Option A; C. Option C

Question 8

A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c.

As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company should be able to report multiple bugs and bugs can also be reported by multiple companies.

What is needed to allow this reporting?

Correct Answer: D. Function object between Bug__c and Account

Question 9

What are three considerations when using the @lnvocableMethod annotation in Apex?

Choose 3 answers

Correct Answer: A. Only one method using the @invecableMethod annotation can be defined per Apex class_; C. A method using the @invocablemethod annotation must be declaredas static,; E. A method using the @invocableMethod annotation can be declared as Public or Global.

Question 10

A developer identifies the following triggers on the Expense _c object:

The triggers process before delete, before insert, and before update events respectively.

Which two techniques should the developer implement to ensure trigger best practices are followed?

Choose 2 answers

Correct Answer: A. Unity all three triggers In a single trigger on the Expense__c object that Includes all events.; C. Create helper classes to execute the appropriate logic when a record is saved.
Explanation:

A . Unify all three triggers in a single trigger on the Expense__c object that includes all events:

Salesforce best practices recommend having only one trigger per object to avoid redundancy and conflicts.

By combining all the events (before delete, before insert, and before update) into a single trigger, the developer can manage the logic in an organized and maintainable manner.

This also simplifies debugging and ensures that the trigger logic executes in a predictable order.

C . Create helper classes to execute the appropriate logic when a record is saved:

Using helper classes allows for a clean separation of concerns. The trigger becomes a dispatcher that delegates logic to dedicated classes.

For example, you can create methods like applyDefaultsToExpense(), validateExpenseUpdate(), and deleteExpense() in a helper class and invoke them from the trigger.

This improves reusability, readability, and testability of the code.

Why not the other options?

B . Unify the before insert and before update triggers and use Flow for the delete action:

While Flow is a powerful tool, it is not ideal for deleting records or replacing Apex trigger functionality, especially when triggers already exist for other events.

D . Maintain all three triggers on the Expense__c object but move the Apex logic out of the trigger definition:

Maintaining multiple triggers on the same object can lead to conflicts and execution order issues, even if the logic is moved to helper classes.


Trigger Best Practices

Trigger Design Patterns

Question 11

Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.

What are two characteristics of declarative development over programmatic customization?

Choose 2 answers

Correct Answer: A. Declarative development does not require Apex test classes.; C. Declarative development can be done using the Setup menu.

Question 12

Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support representative name.

What is the best solution to assign the case to the appropriate support representative?

Correct Answer: A. Use a trigger on the Case object.

Question 13

A developer needs to allow users to complete a form on an Account record that will create a record for a custom object.

The form needs to display different fields depending on the user's job role, The functionality should only be available to a small group of users.

Which three things should the developer do to satisfy these requirements?

Choose 3 answers

Correct Answer: A, B, C, C

Question 14

A developer needs to confirm that a Contact trigger works correctly without changing the organization's data.

What should the developer do to test the Contact trigger?

Correct Answer: C. Use the Test menu on the Developer Console to run oil test classes for the Contact trigger.

Question 15

What does the Lightning Component framework provide to developers?

Correct Answer: B. Prebuilt components that can be reused