ExamGecko
Ask Question

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

List of questions

Question 221

Report
Export
Collapse

A developer is inserting, updating, and deleting multiple lists of records in a Single transaction and wants to ensure that any error prevents all execution.

How should the developer implement error exception handling in their code to handle this?

Use Database methods to obtain lists of Database.SaveResults.
Use Database methods to obtain lists of Database.SaveResults.
Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.
Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.
Use a Try/Catch and use sObject.addError() on any failures.
Use a Try/Catch and use sObject.addError() on any failures.
Use a Try/Catch statement and handle DML cleanup in the catch statement.
Use a Try/Catch statement and handle DML cleanup in the catch statement.
Suggested answer: B
asked 23/09/2024
Minh Phan
29 questions

Question 222

Report
Export
Collapse

A company has reference data stored in multiple Custom Metadata records that represent default information for certain.

When a Contact is inserted, the default information should be set on the Contact from the Custom Metadata records .. Address information.

What is the optimal way to automate this?

Process Builder
Process Builder
Apex Trigger
Apex Trigger
Workflow Rule
Workflow Rule
Visual Flow
Visual Flow
Suggested answer: B
asked 23/09/2024
Angela Cappa
34 questions

Question 223

Report
Export
Collapse

As part of a custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:

• Amount Probability, Stage, or Close Date

What is the most efficient way to Query such information?

[Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld = :oppId];
[Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld = :oppId];
[Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN
[Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN
[Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
[Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
('StageName', Probability',Amount /CloseDate')];
('StageName', Probability',Amount /CloseDate')];
[Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];
[Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];
Suggested answer: C
asked 23/09/2024
Rodwell Shibambu
51 questions

Question 224

Report
Export
Collapse

A developer must perform a complex SOQL query that joins two objects in a Lightning component. how can the Lightning component execute the query?

Use the SaJesforce Streaming API to perform the SOQL query.
Use the SaJesforce Streaming API to perform the SOQL query.
Create a Process Builder to execute the query and invoke from the Lightning component.
Create a Process Builder to execute the query and invoke from the Lightning component.
Invoke an Apex dass with the method annotated as ©AiraEnabled to perform the query.
Invoke an Apex dass with the method annotated as ©AiraEnabled to perform the query.
Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.
Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.
Suggested answer: D
asked 23/09/2024
David Romano
30 questions

Question 225

Report
Export
Collapse

A company needs to automatically delete sensitive information after 7 years. This could delete almost a million records every day.

How can this be achieved?

Schedule an ©future process to Query records older than 7 years, and then recursively invoke itself in 1,000 record batches to delete them.
Schedule an ©future process to Query records older than 7 years, and then recursively invoke itself in 1,000 record batches to delete them.
Perform a SOSL statement to find records older than 7 years, and then delete the entire result set.
Perform a SOSL statement to find records older than 7 years, and then delete the entire result set.
Use aggregate functions to query for records older than 7 years, and then delete the AggregateResult objects.
Use aggregate functions to query for records older than 7 years, and then delete the AggregateResult objects.
Schedule a batch Apex process to run every day that Queries and deletes records older than 7 years.
Schedule a batch Apex process to run every day that Queries and deletes records older than 7 years.
Suggested answer: D
asked 23/09/2024
Arun Pandian
40 questions

Question 226

Report
Export
Collapse

A company has a custom object. Order__c, that has a custom picklist field. Status__c, with values of New, In Progress," or Fulfilled and a lookup field, Contact_c, to Contact.

Which SOQL query wrii return a unique list of all the Contact records that have no Fulfilled Orders?

SELECT Contact_c From order_c Where id NOT IN (SELECT id FROM_c Where States_c + Fulfilled')
SELECT Contact_c From order_c Where id NOT IN (SELECT id FROM_c Where States_c + Fulfilled')
SELECT iD FROM Contact WHERE id NOT IN (SELECT id From order_c WHERE_c = Fulfilled')
SELECT iD FROM Contact WHERE id NOT IN (SELECT id From order_c WHERE_c = Fulfilled')
SELECT Contact_c FROM Order_c Where Status_c <> ;Fulfilled'
SELECT Contact_c FROM Order_c Where Status_c <> ;Fulfilled'
SELECT id FROM Contact WHERE id NOT IN (SELECT Contact _c FROM order_c Where Status_c = fulfilled')
SELECT id FROM Contact WHERE id NOT IN (SELECT Contact _c FROM order_c Where Status_c = fulfilled')
Suggested answer: D
asked 23/09/2024
Trevore Agee
25 questions

Question 227

Report
Export
Collapse

How should a developer assert that a trigger with an asynchronous process has successfully run?

Create at test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.
Create at test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.
Insert records into Salesforce, use seeAllData-true, then perform assertions.
Insert records into Salesforce, use seeAllData-true, then perform assertions.
Create all test data, use @future In the test class, then perform assertions.
Create all test data, use @future In the test class, then perform assertions.
Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions,
Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions,
Suggested answer: D
asked 23/09/2024
Latonya Ganison
27 questions

Question 228

Report
Export
Collapse

A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build an application that can create, retrieve, and update common object records in all of the different orgs.

Which method of integration should the application use?

Apex REST Web Service
Apex REST Web Service
SOAP API with the partner WSDL
SOAP API with the partner WSDL
SOAP API with the Enterprise WSDL
SOAP API with the Enterprise WSDL
Metadata API
Metadata API
Suggested answer: A
asked 23/09/2024
Aparecido Primo
41 questions

Question 229

Report
Export
Collapse

A business process requires sending new Account records to an external system. The Account Name, Id, CreatedDate. and CreatedByld must be passed to the external system in near real-time when an Account is Inserted without error.

How should a developer achieve this?

Use a before insert trigger and an @future method.
Use a before insert trigger and an @future method.
Use a before insert trigger and a Queueable class.
Use a before insert trigger and a Queueable class.
Use a Process Builder that calls an @InvocableMethod method.
Use a Process Builder that calls an @InvocableMethod method.
Use a Workflow rule that calls an @InvocableMethod method.
Use a Workflow rule that calls an @InvocableMethod method.
Suggested answer: A
asked 23/09/2024
Brian Carlo Hubilla
36 questions

Question 230

Report
Export
Collapse

Given the following code:

Salesforce Certified Platform Developer II image Question 230 67877 09232024003105000000

Assuming there were 10 Contacts and five Accounts created today, what is the expected result?

System. QueryException: List has more than one row after Assignment on Account.
System. QueryException: List has more than one row after Assignment on Account.
System. LimitException: To many SOQL Queries on Account.
System. LimitException: To many SOQL Queries on Account.
System. QueryException: To many DML Statement errors on Contact
System. QueryException: To many DML Statement errors on Contact
System. LimitException: Too many SOQL Queries on Contract
System. LimitException: Too many SOQL Queries on Contract
Suggested answer: A
asked 23/09/2024
Dipuo Ngwenya
27 questions
Total 438 questions
Go to page: of 44
Search

Related questions