Looking for more? Click here to get the full PDF with 258+ practice questions for $10 for offline study and deeper preparation.
Question 1
In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?
A. As a List<String> with each value as an element in the list
B. As a String with each value separated by a comma
C. As a String with each value separated by a semicolon
D. As a Set<String> with each value as an element in the set
Show Answer
Correct Answer:
C. As a String with each value separated by a semicolon
Question 2
A developer must build an application that tracks which Accounts have purchased specific pieces of equipment that are represented as Products. Each Account could purchase many pieces of equipment. How should the developer track that an Account has purchased a piece of equipment?
A. Use the Asset object
B. Use a Master-Detail on Product to Account
C. Use a Custom object
D. Use a Lookup on Account to Product
Show Answer
Correct Answer:
A. Use the Asset object
Question 3
Which two scenarios require an Apex method to be called imperatively from a Lightning web component? (Choose two.)
A. Calling a method that makes a web service callout
B. Calling a method that is not annotated with cacheable=true
C. Calling a method with the click of a button
D. Calling a method that is external to the main controller for the Lighting web component
Show Answer
Correct Answer:
B. Calling a method that is not annotated with cacheable=true
C. Calling a method with the click of a button
Question 4
Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace. Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?
A. Declare the class and method using the public access modifier
B. Declare the class as global and use the public access modifier on the method
C. Declare the class as public and use the global access modifier on the method
D. Declare the class and method using the global access modifier
Show Answer
Correct Answer:
D. Declare the class and method using the global access modifier
Question 5
A developer wants to improve runtime performance of Apex calls by caching results on the client. What is the most efficient way to implement this and follow best practices?
A. Decorate the server-side method with @AuraEnabled(storable=true)
B. Set a cookie in the browser for use upon return to the page
C. Call the setStorable() method on the action in the JavaScript client-side code
D. Decorate the server-side method with @AuraEnabled(cacheable=true)
Show Answer
Correct Answer:
D. Decorate the server-side method with @AuraEnabled(cacheable=true)
Question 6
Universal Containers wants Opportunities to no longer be editable when it reaches the Closed/Won stage. Which two strategies can a developer use to accomplish this? (Choose two.)
A. Use a before-save Apex trigger
B. Use a validation rule
C. Use an automatically launched Approval Process
D. Use an auto-response rule
Show Answer
Correct Answer:
A. Use a before-save Apex trigger
B. Use a validation rule
Question 7
A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?
A. ApexPages.currentPage().getParameters().get('url_param')
B. String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get('url_param'))
C. String.ValueOf(ApexPages.currentPage().getParameters().get('url_param'))
D. ApexPages.currentPage().getParameters().get('url_param').escapeHtml4()
Show Answer
Correct Answer:
D. ApexPages.currentPage().getParameters().get('url_param').escapeHtml4()
Question 8
Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage. Which two strategies can a developer use to accomplish this? (Choose two.)
A. Use an after-save flow
B. Use a validation rule
C. Use the Process Automation Settings
D. Use a trigger
Show Answer
Correct Answer:
B. Use a validation rule
C. Use the Process Automation Settings
Question 9
How should a developer create a new custom exception class?
A. public class CustomException extends Exception{}
B. CustomException ex = new (CustomException)Exception();
C. public class CustomException implements Exception{}
D. (Exception)CustomException ex = new Exception();
Show Answer
Correct Answer:
A. public class CustomException extends Exception{}
Question 10
Which three process automations can immediately send an email notification to the owner of an Opportunity when its Amount is changed to be greater than $10,000? (Choose three.)
A. Process Builder
B. Escalation Rule
C. Flow Builder
D. Approval Process
E. Workflow Rule
Show Answer
Correct Answer:
A. Process Builder
C. Flow Builder
E. Workflow Rule
Question 11
What are three considerations when using the @InvocableMethod annotation in Apex? (Choose three.)
A. method using the @InvocableMethod annotation must be declared as static
B. method using the @InvocableMethod annotation can be declared as Public or Global
C. method using the @InvocableMethod annotation can have multiple input parameters
D. method using the @InvocableMethod annotation must define a return value
E. Only one method using the @InvocableMethod annotation can be defined per Apex class
Show Answer
Correct Answer:
A. method using the @InvocableMethod annotation must be declared as static
B. method using the @InvocableMethod annotation can be declared as Public or Global
E. Only one method using the @InvocableMethod annotation can be defined per Apex class
Question 12
Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?
A. registerEvent()
B. fireEvent()
C. emit()
D. fire()
Show Answer
Correct Answer:
D. fire()
Question 13
A developer encounters APEX heap limit errors in a trigger. Which two methods should the developer use to avoid this error? (Choose two.)
A. Use the transient keyword when declaring variables
B. Query and store fields from the related object in a collection when updating related objects
C. Remove or set collections to null after use
D. Use SOQL for loops instead of assigning large queries results to a single collection and looping through the collection
Show Answer
Correct Answer:
C. Remove or set collections to null after use
D. Use SOQL for loops instead of assigning large queries results to a single collection and looping through the collection
Question 14
A business implemented a gamification plan to encourage its customers to watch some educational videos. Customers can watch videos over several days, and their progress is recorded. Award points are granted to customers for all completed videos. When the video is marked as completed in Salesforce, an external web service must be called so that points can be awarded to the user. A developer implemented these requirements in the after update trigger by making a call to an external web service. However, a System.CalloutException is occurring. What should the developer do to fix this error?
A. Surround the external call with a try-catch block to handle the exception
B. Move the callout to a class that implements Queueable and Database.AllowsCallouts Interfaces
C. Replace the after update trigger with a before insert trigger
D. Write a REST service to integrate with the external web service
Show Answer
Correct Answer:
B. Move the callout to a class that implements Queueable and Database.AllowsCallouts Interfaces
Question 15
Which SOQL query successfully returns the Accounts grouped by name?
A. SELECT Type, Max(CreatedDate) FROM Account GROUP BY Name
B. SELECT Name, Max(CreatedDate) FROM Account GROUP BY Name
C. SELECT Id, Type, Max(CreatedDate) FROM Account GROUP BY Name
D. SELECT Type, Name, Max(CreatedDate) FROM Account GROUP BY Name LIMIT 5
Show Answer
Correct Answer:
B. SELECT Name, Max(CreatedDate) FROM Account GROUP BY Name
Question 16
What can be used to delete components from production?
A. change set deployment with a destructiveChanges XML file
B. change set deployment with the delete option checked
C. An ant migration tool deployment with a destructiveChanges XML file and an empty package.xml file
D. An ant migration tool deployment with a desctuctiveChanges XML file and the components to delete in the package.xml file
Show Answer
Correct Answer:
C. An ant migration tool deployment with a destructiveChanges XML file and an empty package.xml file
Question 17
A SSN__c custom field exists on the Candidate__c custom object. The field is used to store each candidate's social security number and is marked as Unique in the schema definition. As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's social security number as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system. Which technique should the developer implement to streamline the data upload?
A. Update the SSN__c field definition to mark it as an External Id
B. Upload the CSV into a custom object related to Candidate__c
C. Create a before insert trigger to correctly map the records
D. Create a Process Builder on the Candidate__c object to map the records
Show Answer
Correct Answer:
A. Update the SSN__c field definition to mark it as an External Id
Question 18
What are three capabilities of the tag when loading JavaScript resources in Aura components? (Choose three.)
A. One-time loading for duplicate scripts
B. Specifying loading order
C. Loading externally hosted scripts
D. Loading files from Documents
E. Loading scripts in parallel
Show Answer
Correct Answer:
A. One-time loading for duplicate scripts
B. Specifying loading order
C. Loading externally hosted scripts
Question 19
Which three declarative fields are correctly mapped to variable types in Apex? (Choose three.)
A. Number maps to Decimal
B. Number maps to Integer
C. TextArea maps to List of type String
D. Date/Time maps to Dateline
E. Checkbox maps to Boolean
Show Answer
Correct Answer:
A. Number maps to Decimal
D. Date/Time maps to Dateline
E. Checkbox maps to Boolean
Question 20
Which two number expressions evaluate correctly? (Choose two.)
A. Double d = 3.14159;
B. Integer I = 3.14159;
C. Decimal d = 3.14159;
D. Long l = 3.14159;
Show Answer
Correct Answer:
A. Double d = 3.14159;
C. Decimal d = 3.14159;
Aced these? Get the Full Exam
Download the complete CRT-450 study bundle with 258+ questions in a single printable PDF.