ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











An Apex trigger and Apex class increment a counter, Edit_Count_c, any time that the Case is changed.

A new process on the case object was just created in production for when a Case is created or updated< since the process was created, they are reports that the Count is being incremented by more than one on Case edit.

Which change in the Apex code will fix the problem?

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

Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.

Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.

The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData().

What is wrong?

A.
The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled also.
A.
The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled also.
Answers
B.
The member's Name and Option should not be declared public.
B.
The member's Name and Option should not be declared public.
Answers
C.
The member's Name and Option should not have getter and setter.
C.
The member's Name and Option should not have getter and setter.
Answers
D.
Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.
D.
Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.
Answers
Suggested answer: A

A company uses Opportunism to track sales to their customers and their org has millions of Opportunities. They want to begging to track revenue over time through a related Revenue object.

As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic.

They estimate that roughly 100,000 Opportunities will have revenue records and populated.

What is the optimal way to automate this?

A.
Use System.enqueueJob>() to Invoke a Queueable class.
A.
Use System.enqueueJob>() to Invoke a Queueable class.
Answers
B.
Use System.scheduleJob() to schedule a Database.Scheduleable class.
B.
Use System.scheduleJob() to schedule a Database.Scheduleable class.
Answers
C.
Use Database.executeBatch() to invoke a Queueable dass.
C.
Use Database.executeBatch() to invoke a Queueable dass.
Answers
D.
Use Database.txtcuteBatch() to invoke a Database.Batchable class.
D.
Use Database.txtcuteBatch() to invoke a Database.Batchable class.
Answers
Suggested answer: D

Which scenario requires a developer to use an Apex callout instead of Outbound Messaging?

A.
The callout needs to be asynchronous.
A.
The callout needs to be asynchronous.
Answers
B.
The callout needs to be invoked from a Workflow Rule.
B.
The callout needs to be invoked from a Workflow Rule.
Answers
C.
The Target system uses a REST API.
C.
The Target system uses a REST API.
Answers
D.
The Target system uses a SOAP API.
D.
The Target system uses a SOAP API.
Answers
Suggested answer: C

A Visualforce Page throws an Attempt to dereference a null object error for a Contact. What change In the controller will fix the error?

A.
Declare a static final Contact at the top of the controller.
A.
Declare a static final Contact at the top of the controller.
Answers
B.
Change the setters signature to return a Contact.
B.
Change the setters signature to return a Contact.
Answers
C.
Use a condition in the getter to return a new Contact if it is null.
C.
Use a condition in the getter to return a new Contact if it is null.
Answers
D.
Change the getter's signature to be static Contact.
D.
Change the getter's signature to be static Contact.
Answers
Suggested answer: C

Universal Containers has a Visualforce page that displays a table every Container_ c being rented by a gives Account.. failing because some of the customers rent over 100,000 containers.

What should a developer change about the Visualforce page to help with the page load errors?

A.
Implement pagination with an OffsetController.
A.
Implement pagination with an OffsetController.
Answers
B.
Implement pagination with a StandardSetController.
B.
Implement pagination with a StandardSetController.
Answers
C.
Use lazy loading and a transient List variable.
C.
Use lazy loading and a transient List variable.
Answers
D.
Use JavaScript remoting with SOQL Offset.
D.
Use JavaScript remoting with SOQL Offset.
Answers
Suggested answer: B

After a Platform Event is defined in a Salesforce org, events can be published via which two mechanisms? Choose 2 answers

A.
internal Apps can use Outbound Messages
A.
internal Apps can use Outbound Messages
Answers
B.
Internal Apps can use Process Builder.
B.
Internal Apps can use Process Builder.
Answers
C.
External Apps require a custom Apex web service.
C.
External Apps require a custom Apex web service.
Answers
D.
External Apps can use the standard Streaming API.
D.
External Apps can use the standard Streaming API.
Answers
Suggested answer: A, B

A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

A.
The event has multiple handlers registered in the project.
A.
The event has multiple handlers registered in the project.
Answers
B.
The event handler calls a trigger.
B.
The event handler calls a trigger.
Answers
C.
An event is fired ontouchend" and is unhandled.
C.
An event is fired ontouchend" and is unhandled.
Answers
D.
The event Is fired from a custom renderer.
D.
The event Is fired from a custom renderer.
Answers
Suggested answer: D

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of ail the test data that is needed to perform the tests.

What should the developer do to speed up test execution?

A.
Define a method that creates test data and annotate with @testSetup.
A.
Define a method that creates test data and annotate with @testSetup.
Answers
B.
Define a method that creates test data and annotate with @createData
B.
Define a method that creates test data and annotate with @createData
Answers
C.
Reduce the amount of test methods in the class.
C.
Reduce the amount of test methods in the class.
Answers
D.
Ensure proper usage of test data factory In all test methods.
D.
Ensure proper usage of test data factory In all test methods.
Answers
Suggested answer: A

A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is dosed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.

What might be causing the failed assertion?

A.
The test class has not defined an Account owner when inserting the test data.
A.
The test class has not defined an Account owner when inserting the test data.
Answers
B.
The test class has not re-queried the Account record after updating the Opportunity.
B.
The test class has not re-queried the Account record after updating the Opportunity.
Answers
C.
The test class has not implemented seeAIIData-truwh the test method.
C.
The test class has not implemented seeAIIData-truwh the test method.
Answers
D.
The test class is not using System.runAs() to run tests as a Salesforce administrator.
D.
The test class is not using System.runAs() to run tests as a Salesforce administrator.
Answers
Suggested answer: B
Total 408 questions
Go to page: of 41