ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











AW Computing (AWC) handles orders in Salesforce and stores its product inventory in a filed, inventory_c, on a custom object. product_c. When an order for a product_c placed, the Inventory_c field is reduced by the quantity of the order using an Apex trigger.

AWC wants to real-time inventory reduction for a product to be sent to many of its external systems, including some future systems the company is currently planning.

What should a developer add to the code at the placeholder to meet these requirements?

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

An end user reports that a Lightning component is performing poorly.

Which two steps should to taken in production to investigate? Choose 2 answers

A.
Enable Debug Mode for Lightning component
A.
Enable Debug Mode for Lightning component
Answers
B.
Print consoIe.log{} statements to identify where actions are delayed.
B.
Print consoIe.log{} statements to identify where actions are delayed.
Answers
C.
Use the salesforce Lightning inspector chrome extension.
C.
Use the salesforce Lightning inspector chrome extension.
Answers
D.
Add a trace flag to the user who reported the issue.
D.
Add a trace flag to the user who reported the issue.
Answers
Suggested answer: C, D

Explanation:


Refer to the test method below:

The test method tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.

The test method fails at the Line 20 because of too many SOQL queries.

What is the correct way to fix this?

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

Explanation:

The correct way to fix this is to add Test.startTest() before and add Test.stopTest() after Line 18 of the code. This will reset the governor limits for the code that executes between these two methods, and allow the test to run without hitting the SOQL query limit.The Test.startTest() and Test.stopTest() methods are used to test code that makes a lot of queries or calls asynchronous methods12. By using these methods, the developer can isolate the code that needs more resources and verify that it does not exceed the governor limits.

Using Limits, startTest, and stopTest | Apex Developer Guide | Salesforce Developers

Test.StartTest & Test.StopTest - Salesforce Developer Community

Universal Containers (UC) has an ERP system that stores customer Information, When an Account is created in Salesforce, the ERP system's REST endpoint for creating new customers must automatically be called with the Account information. If the call to the ERP system falls, the Account should still be created. Accounts in the UC org are only created, one at a time, by users in the UC customer on-boarding department. What should a developer implement to make the call to the ERP system's REST endpoint?

A.
REST call from JavaScript
A.
REST call from JavaScript
Answers
B.
Headless Quick Action
B.
Headless Quick Action
Answers
C.
Call a Queueable from a Trigger
C.
Call a Queueable from a Trigger
Answers
D.
Apex Continuation
D.
Apex Continuation
Answers
Suggested answer: A

Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.

What is the appropriate publish/subscribe logic to meet this requirement?

A.
Have the external system subscribe to a custom Platform Event that gets fired with addError().
A.
Have the external system subscribe to a custom Platform Event that gets fired with addError().
Answers
B.
Have the external system subscribe to a custom Platform Event that gets fired with EventBus.publish(),
B.
Have the external system subscribe to a custom Platform Event that gets fired with EventBus.publish(),
Answers
C.
Have the external system subscribe to a standard Platform Event that gets fired with with Eventbus.publish()
C.
Have the external system subscribe to a standard Platform Event that gets fired with with Eventbus.publish()
Answers
D.
Have the external system subscribe to a standard Platform Event that gets fired.
D.
Have the external system subscribe to a standard Platform Event that gets fired.
Answers
Suggested answer: C

Refer to the following code snippet:

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain criteria are met.

Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?

Choose 3 answers

A.
Annotate the Apex method with @AuraEnabled.
A.
Annotate the Apex method with @AuraEnabled.
Answers
B.
Implement the with sharing keyword in the class declaration.
B.
Implement the with sharing keyword in the class declaration.
Answers
C.
Implement the with keyword in the class declaration.
C.
Implement the with keyword in the class declaration.
Answers
D.
Use the WZ E D clause within the SOQL query.
D.
Use the WZ E D clause within the SOQL query.
Answers
E.
Annotate the Apex method with @AuraEnabled(Cacheable=True).
E.
Annotate the Apex method with @AuraEnabled(Cacheable=True).
Answers
Suggested answer: B, D, E

Universal Containers uses Salesforce to track orders in an order__c object.

The order = object has private organization-wide defaults. The order = object has a custom field, Quality_Controller_c, that is a Lookup to User and is used to indicate that the specified User is performing quality control on the order_ co.

What should be used to automatically give read only access to the User set in the Quality_Controller field?

A.
Record ownership
A.
Record ownership
Answers
B.
Criteria-based sharing
B.
Criteria-based sharing
Answers
C.
Apex managed sharing
C.
Apex managed sharing
Answers
D.
User managed sharing
D.
User managed sharing
Answers
Suggested answer: D

Universal Containers develops a Salesforce application that requires frequent interaction with an external REST API. To avoid duplicating code and improve maintainability, how should they implement the APL integration for code reuse?

A.
Use a separate Apex class for each API endpoint to encapsulate the integration logic
A.
Use a separate Apex class for each API endpoint to encapsulate the integration logic
Answers
B.
Include the API integration code directly in each Apex class that requires it.
B.
Include the API integration code directly in each Apex class that requires it.
Answers
C.
Create a reusable Apex class for the AFL integration and invoke it from the relevant Apex classes.
C.
Create a reusable Apex class for the AFL integration and invoke it from the relevant Apex classes.
Answers
D.
Store the APT integration code as a static resource and reference it in each Apex class.
D.
Store the APT integration code as a static resource and reference it in each Apex class.
Answers
Suggested answer: D
Total 408 questions
Go to page: of 41