ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











A developer created an Apex class that makes outbound RESTful callout. The following was created to send a fake response in Apex test methods.

Which method can be called to return this fake response in the test methods?

A.
TestsetMock
A.
TestsetMock
Answers
B.
TestcreateStub
B.
TestcreateStub
Answers
C.
testSetup
C.
testSetup
Answers
D.
Test.setTestData
D.
Test.setTestData
Answers
Suggested answer: A

A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunity owned by the currently logged-in user.

When the component is rendered, the following message is displayed: "Error retrieving data" Which modification should be implemented to the Apex class to overcome the issue?

A.
Edit the code to use the without sharing keyword in the Apex class.
A.
Edit the code to use the without sharing keyword in the Apex class.
Answers
B.
Use the Cacheable=True attribute in the Apex method.
B.
Use the Cacheable=True attribute in the Apex method.
Answers
C.
Ensure the OWD for the Opportunity object is public.
C.
Ensure the OWD for the Opportunity object is public.
Answers
D.
Use the Continuation=true attribute in the Apex method.
D.
Use the Continuation=true attribute in the Apex method.
Answers
Suggested answer: B

Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving m Account.

How can a developer fix this error?

A.
Split the trigger logic into two separate triggers.
A.
Split the trigger logic into two separate triggers.
Answers
B.
Modify the trigger to use the isMultiThread=true annotation.
B.
Modify the trigger to use the isMultiThread=true annotation.
Answers
C.
Convert trigger to use the ©future annotation, and chain any subsequent trigger invocations to the Account object.
C.
Convert trigger to use the ©future annotation, and chain any subsequent trigger invocations to the Account object.
Answers
D.
Use a helper class to set a Boolean to TRUE the first time a trigger is fired, and then; modify the trigger to only fire when modify the trigger to only fire when the Boolean is FALSE.
D.
Use a helper class to set a Boolean to TRUE the first time a trigger is fired, and then; modify the trigger to only fire when modify the trigger to only fire when the Boolean is FALSE.
Answers
Suggested answer: D

A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process.

During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll, back to SP3 is called, a runtime error occurs.

Why does the developer receive a runtime error?

A.
The developer should have called SP2 before calling SP3.
A.
The developer should have called SP2 before calling SP3.
Answers
B.
SP3 became invalid when SP1 was rolled back.
B.
SP3 became invalid when SP1 was rolled back.
Answers
C.
The developer has too many DML statements between the savepoints.
C.
The developer has too many DML statements between the savepoints.
Answers
D.
The developer used too many savepoints in one trigger session.
D.
The developer used too many savepoints in one trigger session.
Answers
Suggested answer: B

Exhibit.

A developer created a JavaScript function as a part of a Lightning web component (LWC) that surfaces information… about leads by imperatively calling getFetchLeadList when certain criteria are met.

What are these changes the developer should implement in the Apex class above to ensure the LWC can displ… data efficiently while preserving security?

Choose 3 answers

A.
Annotate the Apex method with gAuraEnabled-
A.
Annotate the Apex method with gAuraEnabled-
Answers
B.
Annotate the Apex method with 8AuraEnabled (Cacheable-true).
B.
Annotate the Apex method with 8AuraEnabled (Cacheable-true).
Answers
C.
Use the WITH SECURITY_ENFORCED clause within the SOQL query.
C.
Use the WITH SECURITY_ENFORCED clause within the SOQL query.
Answers
D.
Implement the with sharing keyword in the class declaration.
D.
Implement the with sharing keyword in the class declaration.
Answers
E.
Implement the without sharing keyword in the class declaration.
E.
Implement the without sharing keyword in the class declaration.
Answers
Suggested answer: B, C, D

A developer created a Lightning web component that uses a Lightning-record-edit-force to collect information about Leads. Users complain that they only see one error message at a time when they save a Lead record.

What can the developer use to perform the validations, and allow multiple error messages to be displayed simultaneously?

A.
Apex REST
A.
Apex REST
Answers
B.
External JavaScript Library
B.
External JavaScript Library
Answers
C.
Apex Trigger
C.
Apex Trigger
Answers
D.
Process Builder
D.
Process Builder
Answers
Suggested answer: B

Which code statement includes an Apex method named updateAccount in the class AccountController for use in a Lightning web component?

A.
Import updateAccounts from AccountController';
A.
Import updateAccounts from AccountController';
Answers
B.
Import updateAccounts from @salesforceapexAccountControllerupdateAccounts';
B.
Import updateAccounts from @salesforceapexAccountControllerupdateAccounts';
Answers
C.
Import updateAccounts from @salesforceapex AccountController';
C.
Import updateAccounts from @salesforceapex AccountController';
Answers
D.
Import updateAccounts from AccountControllerupdateAccount';
D.
Import updateAccounts from AccountControllerupdateAccount';
Answers
Suggested answer: B

A developer is building a Lightning web component to get data from an Apex method called getData that takes a parameter, name. The data should be retrieved when the user clicks the Load Data button.

Exhibit.

What must be added to get the data?

A.
Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function.
A.
Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function.
Answers
B.
Add this, account = getData (this,name); to the loadData ( ) function.
B.
Add this, account = getData (this,name); to the loadData ( ) function.
Answers
C.
Add getData ({ name; this,name}) , then (result=> { this.account = result}) to the LeadData ( ) function.
C.
Add getData ({ name; this,name}) , then (result=> { this.account = result}) to the LeadData ( ) function.
Answers
D.
Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed.
D.
Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed.
Answers
Suggested answer: C

Consider the following code snippet:

A developer needs to built an interactive Aura component that responds to the user's input by hiding or showing sections according the user preferences.

What are two best practices the developer can implement to hide or show the powerVserView and srar. daraVserView inner components, based on the value of the attribute isPowexUser?

Choose 2 answers

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

A Lightning web component exists in the system and displays information about the record in context as a modal. Salesforce administrators need to use this component within the Lightning App Builder.

Which two settings should the developer configure within the xml resource file?

Choose 2 answers

A.
Set the IsExposed attribute to True.
A.
Set the IsExposed attribute to True.
Answers
B.
Set the IsVisible attribute to True.
B.
Set the IsVisible attribute to True.
Answers
C.
Specify the target to be lightning__RecordPage.
C.
Specify the target to be lightning__RecordPage.
Answers
D.
Specify the target to be lightning__AppPage.
D.
Specify the target to be lightning__AppPage.
Answers
Suggested answer: A, C
Total 408 questions
Go to page: of 41