ExamGecko
Home Home / Salesforce / Certified Platform Developer II

Salesforce Certified Platform Developer II Practice Test - Questions Answers, Page 22

Question list
Search
Search

List of questions

Search

Related questions











Users report that a button on a custom Lightning Web Component is not working. However, there are no other details provided. What should the developer use to ensure error messages are properly displayed?

A.
Add the <apex:messages/> tag to the component.
A.
Add the <apex:messages/> tag to the component.
Answers
B.
Use the Database method with allOrNone set to false.
B.
Use the Database method with allOrNone set to false.
Answers
C.
Add a Try/Catch block surrounding the DML statement.
C.
Add a Try/Catch block surrounding the DML statement.
Answers
D.
Add JavaScript and HTML to display an error message.
D.
Add JavaScript and HTML to display an error message.
Answers
Suggested answer: D

A developer receives the exception 'SOQL query not selective enough' when performing a query on an object with a large amount of dat a. Which step should be taken to resolve the issue?

A.
Use an ID in the WHERE clause of the SOQL query.
A.
Use an ID in the WHERE clause of the SOQL query.
Answers
B.
Perform the SOQL query as part of a FOR loop.
B.
Perform the SOQL query as part of a FOR loop.
Answers
C.
Perform the SOQL query via a call to the REST API.
C.
Perform the SOQL query via a call to the REST API.
Answers
D.
Move the SOQL query to within an asynchronous process.
D.
Move the SOQL query to within an asynchronous process.
Answers
Suggested answer: A

How should a developer verify that a specific Account record is being tested in a test class for a visualforce controller?

A.
Insert the Account in the test class, instantiate the page reference in the test class, then use System.currentPageReference().getParameters{}.put() to set the Account ID.
A.
Insert the Account in the test class, instantiate the page reference in the test class, then use System.currentPageReference().getParameters{}.put() to set the Account ID.
Answers
B.
Instantiate the page reference in the test class, insert the Account in the test class, then use seeAHData-true to view the Account.
B.
Instantiate the page reference in the test class, insert the Account in the test class, then use seeAHData-true to view the Account.
Answers
C.
Insert the Account into Salesforce, instantiate the page reference in the test class, then use System.setParentRecordId().get() to set the Account ID.
C.
Insert the Account into Salesforce, instantiate the page reference in the test class, then use System.setParentRecordId().get() to set the Account ID.
Answers
D.
Instantiate the page reference in the test class, insert the Account in the test class, then use System.setParentRecordld().get() to set the Account ID.
D.
Instantiate the page reference in the test class, insert the Account in the test class, then use System.setParentRecordld().get() to set the Account ID.
Answers
Suggested answer: A

A managed package uses a list of country ISO codes and country names as references data in many different places.. managed package Apex code.

What is the optimal way to store and retrieve the list?

A.
Store the information in Custom Metadata and query it with SOQL.
A.
Store the information in Custom Metadata and query it with SOQL.
Answers
B.
Store the information in Custom Metadata and access it with the getAll() method.
B.
Store the information in Custom Metadata and access it with the getAll() method.
Answers
C.
Store the information in a List Custom Setting and query it with SOQL.
C.
Store the information in a List Custom Setting and query it with SOQL.
Answers
D.
Store the information in a list Custom Setting and access it with the getAll() method
D.
Store the information in a list Custom Setting and access it with the getAll() method
Answers
Suggested answer: C

A Lightning Component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the Description field output on their mobile devices and tablets.

Which option has the changes to make the component responsive for mobile and tablet devices?

A.
A.
Answers
B.
B.
Answers
C.
C.
Answers
D.
D.
Answers
Suggested answer: D

A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created.

Which consideration should be checked to resolve the issue?

A.
Ensure the Apex Classes are on the same API version.
A.
Ensure the Apex Classes are on the same API version.
Answers
B.
Ensure Process Builder processes are inactive.
B.
Ensure Process Builder processes are inactive.
Answers
C.
Ensure the sandbox is on the same release as production.
C.
Ensure the sandbox is on the same release as production.
Answers
D.
Ensure Workflow Rules are inactive.
D.
Ensure Workflow Rules are inactive.
Answers
Suggested answer: C

Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c.

Which two queries are optimized for large data volumes? Choose 2 answers

A.
SELECT Id FROM Account WHERE Id IN : aListVariable
A.
SELECT Id FROM Account WHERE Id IN : aListVariable
Answers
B.
SELECT Id FROM Account WHERE Name != ' ' AND IsDeleted = false
B.
SELECT Id FROM Account WHERE Name != ' ' AND IsDeleted = false
Answers
C.
SELECT Id FROM Account WHERE Name != NULL
C.
SELECT Id FROM Account WHERE Name != NULL
Answers
D.
SELECT Id FROM Account WHERE Name != ' ' AND Customer Number c = 'ValueA'
D.
SELECT Id FROM Account WHERE Name != ' ' AND Customer Number c = 'ValueA'
Answers
Suggested answer: A, D

A developer wants to use an Aura Component with a Custom Action.

What should be considered in order to do this?

A.
A default value must be provided for each component attribute marked as required.
A.
A default value must be provided for each component attribute marked as required.
Answers
B.
The component must implement the force:lightningQuickActionButton interface.
B.
The component must implement the force:lightningQuickActionButton interface.
Answers
C.
The component's JavaScript controller must handle a method on initialization.
C.
The component's JavaScript controller must handle a method on initialization.
Answers
D.
The class "slds-modal__container" must be added to the top-level element of the component.
D.
The class "slds-modal__container" must be added to the top-level element of the component.
Answers
Suggested answer: B

A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input, when the search Is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.

What is the optimal code that should be added to fire the event when the search has completed?

A.
A.
Answers
B.
B.
Answers
C.
C.
Answers
D.
D.
Answers
Suggested answer: B

Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users.

What are two alternatives to implement the integration and protect against malicious calls to Heroku app's endpoint? Choose 2 answers

A.
Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and someform of pre-shared secret key. so that the Heroku app can authenticate requests and store the resizedimages in Salesforce.
A.
Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and someform of pre-shared secret key. so that the Heroku app can authenticate requests and store the resizedimages in Salesforce.
Answers
B.
Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data; thereforethe Heroku app can automatically reply back to the callout with the resized images in Salesforce.
B.
Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data; thereforethe Heroku app can automatically reply back to the callout with the resized images in Salesforce.
Answers
C.
Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce.
C.
Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce.
Answers
D.
Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce.
D.
Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce.
Answers
Suggested answer: C, D
Total 408 questions
Go to page: of 41