ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











Users complain that a page Is very slow to respond. Upon investigation, the query below Is found to perform slowly.

SELECT id, Name FROM Contact WHERE CustomField_c null;

Which two actions can a developer take to improve performance?

Choose 2 answers

A.
Add a UMir dause to the query to reduce the number of records returned.
A.
Add a UMir dause to the query to reduce the number of records returned.
Answers
B.
Contact Salesforce customer support to create a custom index to include null values
B.
Contact Salesforce customer support to create a custom index to include null values
Answers
C.
Make the CustomFleld__c field an External ID.
C.
Make the CustomFleld__c field an External ID.
Answers
D.
Make the field CustomReW__c required because Salesforce field Indexes do not Include nulls.
D.
Make the field CustomReW__c required because Salesforce field Indexes do not Include nulls.
Answers
Suggested answer: A, D

A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.

The test class is below:

What is causing the code coverage problem?

A.
The batch process will not recognize new accounts created in the same session
A.
The batch process will not recognize new accounts created in the same session
Answers
B.
The account creation already sets the sates amount to 0.
B.
The account creation already sets the sates amount to 0.
Answers
C.
The executeBatch must fail within test. startTest ( ) and – test. stopTest().
C.
The executeBatch must fail within test. startTest ( ) and – test. stopTest().
Answers
D.
The batch needs more than one account record created.
D.
The batch needs more than one account record created.
Answers
Suggested answer: C

A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

Caura: component implements-"forcethaaRecordid, flexipage:availableForAllPageTypes">

<div>Hello!</div>

</aura:component> How can the component's controller get the context of the Lightning page that the sobject is an without requiring additional best coverage?

A.
Use the getSObjectType () method in an Apex class
A.
Use the getSObjectType () method in an Apex class
Answers
B.
Create a design attribute and configure via App Builder
B.
Create a design attribute and configure via App Builder
Answers
C.
Set the object type as a component attribute.
C.
Set the object type as a component attribute.
Answers
D.
Add force:hasSobjectName to the implements attribute
D.
Add force:hasSobjectName to the implements attribute
Answers
Suggested answer: D

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user.

The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, *Maximum view state size limit exceeded.

What step should the developer take to resolve this issue?

A.
Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex Controller.
A.
Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex Controller.
Answers
B.
Adjust any code that filters by picklist values since they are not indexed.
B.
Adjust any code that filters by picklist values since they are not indexed.
Answers
C.
Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.
C.
Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.
Answers
D.
Remove instances of the transient keyword from the Apex controller to avoid the view state error.
D.
Remove instances of the transient keyword from the Apex controller to avoid the view state error.
Answers
Suggested answer: C

The Account edit button must be overridden in an org where a subset of users still use Salesforce Classic. The org already has a Lightning Component that will do the work necessary for the override, and the client wants to be able to reuse it,

How should a developer implement this?

A.
Override the edit button for both Lightning and Classic with a Lightning Component.
A.
Override the edit button for both Lightning and Classic with a Lightning Component.
Answers
B.
Override the edit button for Lightning with a Lightning Page; and for Classic, override the edit button with a Visualforce pag That contains the Lightning Component.
B.
Override the edit button for Lightning with a Lightning Page; and for Classic, override the edit button with a Visualforce pag That contains the Lightning Component.
Answers
C.
Override the edit button for Lightning with a Lightning Component; and for Classic, override the edit button with a Visualforce page that contains the Lightning Component.
C.
Override the edit button for Lightning with a Lightning Component; and for Classic, override the edit button with a Visualforce page that contains the Lightning Component.
Answers
D.
the edit button for both Lightning and Classic with a new Visualforce page.
D.
the edit button for both Lightning and Classic with a new Visualforce page.
Answers
Suggested answer: C

Universal Containers needs to integrate with their own, existing, internal custom web application.

The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce.

What should the developer use to implement this integration?

A.
A workflow rule with an outbound message that contains a session ID
A.
A workflow rule with an outbound message that contains a session ID
Answers
B.
An Apex trigger that calls an @future method that allows callouts
B.
An Apex trigger that calls an @future method that allows callouts
Answers
C.
A platform event that makes a callout to the web application
C.
A platform event that makes a callout to the web application
Answers
D.
A flow that calls an @future method that allows callouts
D.
A flow that calls an @future method that allows callouts
Answers
Suggested answer: C

As part of a custom development, a developer creates a Lightning component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:

• Amount, Probability, Stage, or Close Date

How should the developer access the data that must be displayed?

A.
Execute a SOQL query for Amount, Probability, Stage, and Close Date on the OpportunityHistory object.
A.
Execute a SOQL query for Amount, Probability, Stage, and Close Date on the OpportunityHistory object.
Answers
B.
Create custom a custom date field on Opportunity for each field to track the previous date and execute a SOQL query for date fields.
B.
Create custom a custom date field on Opportunity for each field to track the previous date and execute a SOQL query for date fields.
Answers
C.
Subscribe to the Opportunity Change Data Capture event in the Lightning component.
C.
Subscribe to the Opportunity Change Data Capture event in the Lightning component.
Answers
D.
Subscribe to the OpportunityHistory Change Data Capture event in the Lightning component.
D.
Subscribe to the OpportunityHistory Change Data Capture event in the Lightning component.
Answers
Suggested answer: B

Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer. Recently a workflow rule was added so that whenever an Account is marked as a Customer, a 'Customer

Since' date field is updated with today's date.

Since the addition of the workflow rule, two Account Plan records are created whenever the Account is marked as a Customer.

What might cause this to happen?

A.
The workflow rule is configured to evaluate when a record is created and every time it is edited.
A.
The workflow rule is configured to evaluate when a record is created and every time it is edited.
Answers
B.
The workflow rule field update is marked as 'Re-evaluate Workflow Rules After Field Change."
B.
The workflow rule field update is marked as 'Re-evaluate Workflow Rules After Field Change."
Answers
C.
The Apex trigger does not use a static variable to ensure it only fires once.
C.
The Apex trigger does not use a static variable to ensure it only fires once.
Answers
D.
The Apex trigger is not bulk safe and calls insert inside of a for loop.
D.
The Apex trigger is not bulk safe and calls insert inside of a for loop.
Answers
Suggested answer: C

A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price.

What must be added to display the total?

A.
Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template.
A.
Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template.
Answers
B.
Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template.
B.
Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template.
Answers
C.
Add Total: {quantity * UnitPrice} in the template.
C.
Add Total: {quantity * UnitPrice} in the template.
Answers
D.
Add Total; {multiple quantit,y unitprice)} in the template.
D.
Add Total; {multiple quantit,y unitprice)} in the template.
Answers
Suggested answer: B

Which two scenarios require an Apex method to be called imperatively from a Lightning web component?

Choose 2 answers

A.
Calling a method that makes a web service callout
A.
Calling a method that makes a web service callout
Answers
B.
Calling a method that is not annotated with cacheable=true
B.
Calling a method that is not annotated with cacheable=true
Answers
C.
Calling a method with the click of a button
C.
Calling a method with the click of a button
Answers
D.
Calling a method that is external to the main controller for the Lightning web component
D.
Calling a method that is external to the main controller for the Lightning web component
Answers
Suggested answer: B, C
Total 408 questions
Go to page: of 41