ExamGecko
Ask Question

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

List of questions

Question 201

Report
Export
Collapse

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

Salesforce Certified Platform Developer II image Question 201 67848 09232024003105000000

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?

Suggested answer: A
asked 23/09/2024
Bruno De Brida
30 questions

Question 202

Report
Export
Collapse

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

Salesforce Certified Platform Developer II image Question 202 67849 09232024003105000000

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?

The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled also.
The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled also.
The member's Name and Option should not be declared public.
The member's Name and Option should not be declared public.
The member's Name and Option should not have getter and setter.
The member's Name and Option should not have getter and setter.
Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.
Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component.
Suggested answer: A
asked 23/09/2024
Vasco Rodrigues
40 questions

Question 203

Report
Export
Collapse

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?

Use System.enqueueJob>() to Invoke a Queueable class.
Use System.enqueueJob>() to Invoke a Queueable class.
Use System.scheduleJob() to schedule a Database.Scheduleable class.
Use System.scheduleJob() to schedule a Database.Scheduleable class.
Use Database.executeBatch() to invoke a Queueable dass.
Use Database.executeBatch() to invoke a Queueable dass.
Use Database.txtcuteBatch() to invoke a Database.Batchable class.
Use Database.txtcuteBatch() to invoke a Database.Batchable class.
Suggested answer: D
asked 23/09/2024
Batista Moreira
38 questions

Question 204

Report
Export
Collapse

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

The callout needs to be asynchronous.
The callout needs to be asynchronous.
The callout needs to be invoked from a Workflow Rule.
The callout needs to be invoked from a Workflow Rule.
The Target system uses a REST API.
The Target system uses a REST API.
The Target system uses a SOAP API.
The Target system uses a SOAP API.
Suggested answer: C
asked 23/09/2024
James Valdivia
30 questions

Question 205

Report
Export
Collapse

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

Declare a static final Contact at the top of the controller.
Declare a static final Contact at the top of the controller.
Change the setters signature to return a Contact.
Change the setters signature to return a Contact.
Use a condition in the getter to return a new Contact if it is null.
Use a condition in the getter to return a new Contact if it is null.
Change the getter's signature to be static Contact.
Change the getter's signature to be static Contact.
Suggested answer: C
asked 23/09/2024
Rui Afonso
29 questions

Question 206

Report
Export
Collapse

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?

Implement pagination with an OffsetController.
Implement pagination with an OffsetController.
Implement pagination with a StandardSetController.
Implement pagination with a StandardSetController.
Use lazy loading and a transient List variable.
Use lazy loading and a transient List variable.
Use JavaScript remoting with SOQL Offset.
Use JavaScript remoting with SOQL Offset.
Suggested answer: B
asked 23/09/2024
Tural Pashayev
28 questions

Question 207

Report
Export
Collapse

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

internal Apps can use Outbound Messages
internal Apps can use Outbound Messages
Internal Apps can use Process Builder.
Internal Apps can use Process Builder.
External Apps require a custom Apex web service.
External Apps require a custom Apex web service.
External Apps can use the standard Streaming API.
External Apps can use the standard Streaming API.
Suggested answer: A, B
asked 23/09/2024
gokulakrishna S B
37 questions

Question 208

Report
Export
Collapse

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

The event has multiple handlers registered in the project.
The event has multiple handlers registered in the project.
The event handler calls a trigger.
The event handler calls a trigger.
An event is fired ontouchend" and is unhandled.
An event is fired ontouchend" and is unhandled.
The event Is fired from a custom renderer.
The event Is fired from a custom renderer.
Suggested answer: D
asked 23/09/2024
Spandana Gangavaram
30 questions

Question 209

Report
Export
Collapse

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?

Define a method that creates test data and annotate with @testSetup.
Define a method that creates test data and annotate with @testSetup.
Define a method that creates test data and annotate with @createData
Define a method that creates test data and annotate with @createData
Reduce the amount of test methods in the class.
Reduce the amount of test methods in the class.
Ensure proper usage of test data factory In all test methods.
Ensure proper usage of test data factory In all test methods.
Suggested answer: A
asked 23/09/2024
Muhammad Hafizh
29 questions

Question 210

Report
Export
Collapse

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?

The test class has not defined an Account owner when inserting the test data.
The test class has not defined an Account owner when inserting the test data.
The test class has not re-queried the Account record after updating the Opportunity.
The test class has not re-queried the Account record after updating the Opportunity.
The test class has not implemented seeAIIData-truwh the test method.
The test class has not implemented seeAIIData-truwh the test method.
The test class is not using System.runAs() to run tests as a Salesforce administrator.
The test class is not using System.runAs() to run tests as a Salesforce administrator.
Suggested answer: B
asked 23/09/2024
Tracy Nicholas
33 questions
Total 438 questions
Go to page: of 44
Search

Related questions