ExamGecko
Home Home / Salesforce / Certified Platform Developer II

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

Question list
Search
Search

List of questions

Search

Related questions











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?

A.
Use Database methods to obtain lists of Database.SaveResults.
A.
Use Database methods to obtain lists of Database.SaveResults.
Answers
B.
Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.
B.
Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.
Answers
C.
Use a Try/Catch and use sObject.addError() on any failures.
C.
Use a Try/Catch and use sObject.addError() on any failures.
Answers
D.
Use a Try/Catch statement and handle DML cleanup in the catch statement.
D.
Use a Try/Catch statement and handle DML cleanup in the catch statement.
Answers
Suggested answer: B

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?

A.
Process Builder
A.
Process Builder
Answers
B.
Apex Trigger
B.
Apex Trigger
Answers
C.
Workflow Rule
C.
Workflow Rule
Answers
D.
Visual Flow
D.
Visual Flow
Answers
Suggested answer: B

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?

A.
[Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld = :oppId];
A.
[Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld = :oppId];
Answers
B.
[Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN
B.
[Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN
Answers
C.
[Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
C.
[Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
Answers
D.
('StageName', Probability',Amount /CloseDate')];
D.
('StageName', Probability',Amount /CloseDate')];
Answers
E.
[Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];
E.
[Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];
Answers
Suggested answer: C

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

A.
Use the SaJesforce Streaming API to perform the SOQL query.
A.
Use the SaJesforce Streaming API to perform the SOQL query.
Answers
B.
Create a Process Builder to execute the query and invoke from the Lightning component.
B.
Create a Process Builder to execute the query and invoke from the Lightning component.
Answers
C.
Invoke an Apex dass with the method annotated as ©AiraEnabled to perform the query.
C.
Invoke an Apex dass with the method annotated as ©AiraEnabled to perform the query.
Answers
D.
Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.
D.
Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.
Answers
Suggested answer: D

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?

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

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?

A.
SELECT Contact_c From order_c Where id NOT IN (SELECT id FROM_c Where States_c + Fulfilled')
A.
SELECT Contact_c From order_c Where id NOT IN (SELECT id FROM_c Where States_c + Fulfilled')
Answers
B.
SELECT iD FROM Contact WHERE id NOT IN (SELECT id From order_c WHERE_c = Fulfilled')
B.
SELECT iD FROM Contact WHERE id NOT IN (SELECT id From order_c WHERE_c = Fulfilled')
Answers
C.
SELECT Contact_c FROM Order_c Where Status_c <> ;Fulfilled'
C.
SELECT Contact_c FROM Order_c Where Status_c <> ;Fulfilled'
Answers
D.
SELECT id FROM Contact WHERE id NOT IN (SELECT Contact _c FROM order_c Where Status_c = fulfilled')
D.
SELECT id FROM Contact WHERE id NOT IN (SELECT Contact _c FROM order_c Where Status_c = fulfilled')
Answers
Suggested answer: D

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

A.
Create at test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.
A.
Create at test data in the test class, use System.runAs() to invoke the trigger, then perform assertions.
Answers
B.
Insert records into Salesforce, use seeAllData-true, then perform assertions.
B.
Insert records into Salesforce, use seeAllData-true, then perform assertions.
Answers
C.
Create all test data, use @future In the test class, then perform assertions.
C.
Create all test data, use @future In the test class, then perform assertions.
Answers
D.
Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions,
D.
Create all test data in the test class, invoke Test.startTest() and Test.stopTest() and then perform assertions,
Answers
Suggested answer: D

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?

A.
Apex REST Web Service
A.
Apex REST Web Service
Answers
B.
SOAP API with the partner WSDL
B.
SOAP API with the partner WSDL
Answers
C.
SOAP API with the Enterprise WSDL
C.
SOAP API with the Enterprise WSDL
Answers
D.
Metadata API
D.
Metadata API
Answers
Suggested answer: A

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?

A.
Use a before insert trigger and an @future method.
A.
Use a before insert trigger and an @future method.
Answers
B.
Use a before insert trigger and a Queueable class.
B.
Use a before insert trigger and a Queueable class.
Answers
C.
Use a Process Builder that calls an @InvocableMethod method.
C.
Use a Process Builder that calls an @InvocableMethod method.
Answers
D.
Use a Workflow rule that calls an @InvocableMethod method.
D.
Use a Workflow rule that calls an @InvocableMethod method.
Answers
Suggested answer: A

Given the following code:

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

A.
System. QueryException: List has more than one row after Assignment on Account.
A.
System. QueryException: List has more than one row after Assignment on Account.
Answers
B.
System. LimitException: To many SOQL Queries on Account.
B.
System. LimitException: To many SOQL Queries on Account.
Answers
C.
System. QueryException: To many DML Statement errors on Contact
C.
System. QueryException: To many DML Statement errors on Contact
Answers
D.
System. LimitException: Too many SOQL Queries on Contract
D.
System. LimitException: Too many SOQL Queries on Contract
Answers
Suggested answer: A
Total 408 questions
Go to page: of 41