ExamGecko
Ask Question

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

List of questions

Question 41

Report
Export
Collapse

Which two relationship queries use the proper syntax? Choose 2 answers

SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
SELECT Id, Name, Account __r.Name FROM Contact WHERE Account r.Industry = 'Media'
SELECT Id, Name, Account __r.Name FROM Contact WHERE Account r.Industry = 'Media'
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
Suggested answer: B, D
asked 23/09/2024
Gregory Pollack
32 questions

Question 42

Report
Export
Collapse

A developer built a Component to be used at the front desk for guests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk.

What should be used?

Changelog
Changelog
Component Event
Component Event
Application Event
Application Event
DML Operation
DML Operation
Suggested answer: C
asked 23/09/2024
Sebastian Romero
45 questions

Question 43

Report
Export
Collapse

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

Suggested answer: A
asked 23/09/2024
Thomas Kincer
39 questions

Question 44

Report
Export
Collapse

An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance. When a test batch of records are loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created. What is the most extendable way to update the Apex Trigger to accomplish this?

Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.
Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.
Use a List Custom Setting to disable the Trigger for the user who does the data loading.
Use a List Custom Setting to disable the Trigger for the user who does the data loading.
add the Profile Id of the user who does the data loading to the Trigger so the Trigger won't fire for this user.
add the Profile Id of the user who does the data loading to the Trigger so the Trigger won't fire for this user.
Suggested answer: A
asked 23/09/2024
Helania Stevenson
51 questions

Question 45

Report
Export
Collapse

Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

use the Database.Delete method if the Contact insertion fails.
use the Database.Delete method if the Contact insertion fails.
Disable validation rules on Contacts and set default values with a Trigger.
Disable validation rules on Contacts and set default values with a Trigger.
use the Database.Insert method with allOrNone set to False.
use the Database.Insert method with allOrNone set to False.
use setSavePoint() and rollback() with a try/catch block.
use setSavePoint() and rollback() with a try/catch block.
Suggested answer: D
asked 23/09/2024
Rodwell Shibambu
51 questions

Question 46

Report
Export
Collapse

Salesforce Certified Platform Developer II image Question 46 67693 09232024003104000000

Consider the above trigger intended to assign the Account to the manager of the Account"s region.

Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers

Use a Map accountMap instead of List accountList.
Use a Map accountMap instead of List accountList.
Use a Map to cache the results of the Region__c query by Id.
Use a Map to cache the results of the Region__c query by Id.
Move the Region__c query to outside the loop.
Move the Region__c query to outside the loop.
Remove the last line updating accountList as it is not needed.
Remove the last line updating accountList as it is not needed.
Suggested answer: C, D
asked 23/09/2024
Chet Camlin
33 questions

Question 47

Report
Export
Collapse

Example 1: AggregateResult[] groupedResults = [SELECT Campaignid, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResuits) { System.debug ('Campaign ID' + ar.get('CampaignId'-); System.debug ('Average amount' + ar.get('exprd')); } Example 2: AggregateResult[] groupedResults = [SELECT Campaignid, AVG(Amount) theAverage FROM Opportunity GROUP BY Campaignid]; for (AggregateResult ar : groupedResuits) { System.debug(*Campaign ID' + ar.get('CampaignId')); System.debug ('Average amount' + ar.get('theAverage')); } Example 3: AggregateResult[] groupedResults = [SELECT CampaignId, AVG (Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResuits) System.debug(*Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get.AVG(- ); } Example 4:AggregateResult[] groupedResults = [SELECT CampaigniId, AVG(Amount) theAverage FROM Opportunity GROUP BY Campaignid]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug ('Average amount' + ar.theAverage-; } Which two of the examples above have correct System.debug statements? Choose 2 answers

Example 1
Example 1
Example 2
Example 2
Example 3
Example 3
Example 4
Example 4
Suggested answer: A, B
asked 23/09/2024
Richard lavery
38 questions

Question 48

Report
Export
Collapse

Which method should be used to convert a Date to a String in the current user's locale?

Date.format
Date.format
Date.parse
Date.parse
String.format
String.format
String. valueOf
String. valueOf
Suggested answer: A
asked 23/09/2024
Jordan Arribas Aranda
36 questions

Question 49

Report
Export
Collapse

A company has a custom object, Order__c, that has a required, unique, external ID field called Order_Number__c. Which statement should be used to perform the DML necessary to insert new records and update existing records in a List of Order__c records?

upsert orders;
upsert orders;
merge orders;
merge orders;
merge orders Order_Number__c;
merge orders Order_Number__c;
upsert orders Order_Number__c;
upsert orders Order_Number__c;
Suggested answer: D
asked 23/09/2024
Premier Lane
36 questions

Question 50

Report
Export
Collapse

A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system. What is the optimal way to update the Accounts from the external system?

Apex REST Web Service
Apex REST Web Service
Composite REST API
Composite REST API
SOAP API
SOAP API
Bulk API
Bulk API
Suggested answer: A
asked 23/09/2024
Renaldo Williams
43 questions
Total 438 questions
Go to page: of 44
Search

Related questions