ExamGecko
Ask Question

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

List of questions

Question 301

Report
Export
Collapse

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

Salesforce Certified Platform Developer II image Question 301 67948 09232024003105000000

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

TestsetMock
TestsetMock
TestcreateStub
TestcreateStub
testSetup
testSetup
Test.setTestData
Test.setTestData
Suggested answer: A
asked 23/09/2024
Ruben Dallibor
32 questions

Question 302

Report
Export
Collapse

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?

Edit the code to use the without sharing keyword in the Apex class.
Edit the code to use the without sharing keyword in the Apex class.
Use the Cacheable=True attribute in the Apex method.
Use the Cacheable=True attribute in the Apex method.
Ensure the OWD for the Opportunity object is public.
Ensure the OWD for the Opportunity object is public.
Use the Continuation=true attribute in the Apex method.
Use the Continuation=true attribute in the Apex method.
Suggested answer: B
asked 23/09/2024
Arjen Vleugel
44 questions

Question 303

Report
Export
Collapse

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

How can a developer fix this error?

Split the trigger logic into two separate triggers.
Split the trigger logic into two separate triggers.
Modify the trigger to use the isMultiThread=true annotation.
Modify the trigger to use the isMultiThread=true annotation.
Convert trigger to use the ©future annotation, and chain any subsequent trigger invocations to the Account object.
Convert trigger to use the ©future annotation, and chain any subsequent trigger invocations to the Account object.
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.
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.
Suggested answer: D
asked 23/09/2024
Franckline Dormeus
44 questions

Question 304

Report
Export
Collapse

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?

The developer should have called SP2 before calling SP3.
The developer should have called SP2 before calling SP3.
SP3 became invalid when SP1 was rolled back.
SP3 became invalid when SP1 was rolled back.
The developer has too many DML statements between the savepoints.
The developer has too many DML statements between the savepoints.
The developer used too many savepoints in one trigger session.
The developer used too many savepoints in one trigger session.
Suggested answer: B
asked 23/09/2024
EVA LITA
40 questions

Question 305

Report
Export
Collapse

Exhibit.

Salesforce Certified Platform Developer II image Question 305 67952 09232024003105000000

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

Annotate the Apex method with gAuraEnabled-
Annotate the Apex method with gAuraEnabled-
Annotate the Apex method with 8AuraEnabled (Cacheable-true).
Annotate the Apex method with 8AuraEnabled (Cacheable-true).
Use the WITH SECURITY_ENFORCED clause within the SOQL query.
Use the WITH SECURITY_ENFORCED clause within the SOQL query.
Implement the with sharing keyword in the class declaration.
Implement the with sharing keyword in the class declaration.
Implement the without sharing keyword in the class declaration.
Implement the without sharing keyword in the class declaration.
Suggested answer: B, C, D
asked 23/09/2024
wasiu adio
28 questions

Question 306

Report
Export
Collapse

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?

Apex REST
Apex REST
External JavaScript Library
External JavaScript Library
Apex Trigger
Apex Trigger
Process Builder
Process Builder
Suggested answer: B
asked 23/09/2024
Lucas Bila
34 questions

Question 307

Report
Export
Collapse

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

Import updateAccounts from AccountController';
Import updateAccounts from AccountController';
Import updateAccounts from @salesforceapexAccountControllerupdateAccounts';
Import updateAccounts from @salesforceapexAccountControllerupdateAccounts';
Import updateAccounts from @salesforceapex AccountController';
Import updateAccounts from @salesforceapex AccountController';
Import updateAccounts from AccountControllerupdateAccount';
Import updateAccounts from AccountControllerupdateAccount';
Suggested answer: B
asked 23/09/2024
Ivan Ramirez
28 questions

Question 308

Report
Export
Collapse

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.

Salesforce Certified Platform Developer II image Question 308 67955 09232024003105000000

What must be added to get the data?

Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function.
Add @wire(getData, (name: $name')} to the account field and this, account = getData ( ) ; to t loadData ( ) function.
Add this, account = getData (this,name); to the loadData ( ) function.
Add this, account = getData (this,name); to the loadData ( ) function.
Add getData ({ name; this,name}) , then (result=> { this.account = result}) to the LeadData ( ) function.
Add getData ({ name; this,name}) , then (result=> { this.account = result}) to the LeadData ( ) function.
Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed.
Add @wire(getData, {name: $name'}) to the account field and delete loadData ( ) because it is not needed.
Suggested answer: C
asked 23/09/2024
Robert Andrade
47 questions

Question 309

Report
Export
Collapse

Consider the following code snippet:

Salesforce Certified Platform Developer II image Question 309 67956 09232024003105000000

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

Suggested answer: B
asked 23/09/2024
Tracy Sampson
34 questions

Question 310

Report
Export
Collapse

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

Set the IsExposed attribute to True.
Set the IsExposed attribute to True.
Set the IsVisible attribute to True.
Set the IsVisible attribute to True.
Specify the target to be lightning__RecordPage.
Specify the target to be lightning__RecordPage.
Specify the target to be lightning__AppPage.
Specify the target to be lightning__AppPage.
Suggested answer: A, C
asked 23/09/2024
Hendrik van Bemmel
32 questions
Total 438 questions
Go to page: of 44
Search

Related questions