NEW 2024 Certification Sample Questions PDII Dumps & Practice Exam
PDII Deluxe Study Guide with Online Test Engine
NEW QUESTION # 109
Which two relationship queries use the proper syntax? (Choose two.)
SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry
- A. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'
- B. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
- C. 'Media'
- D. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
Answer: A,B
NEW QUESTION # 110
A developer created a class that implement he Queueable interface, as follows:
As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers
- A. Enclose System.enqueueJob (new orderQueueable Job ( }) within Test. starttest and Test, stoptest ()
- B. Ensure the running user of the test class has, at least, the View All permission on the Order object
- C. Implement seeAllData-true to ensure the Queueable )ob is able to run in bulk mode.
- D. Implement Test.isRunningtest ( ) to prevent chaining jobs during test execution.
Answer: C,D
NEW QUESTION # 111
A customer requires that when the billing address field on an Account gets updated, the address field on all its related contact records should reflect the same update. How can this requirement be met with minimal customizations?
- A. Create a scheduled batch job that updates all contact address fields based on the related Account record.
- B. Create a Workflow Rule on Account to update related child Contact records.
- C. Create an After Trigger on Account to update its related contact records on update.
- D. Create a Lightning Process on Account to update related child Contact records.
Answer: D
NEW QUESTION # 112
For compliance purposes, a company is required to track long-term product usage in their org. The information that they need to log will be collected from more than one object and, over time, they predict they will have hundreds of millions of records.
What should a developer use to implement this?
- A. Setup audit trail
- B. Field history tracking
- C. Big objects
- D. Field audit trail
Answer: C
Explanation:
Big objects provide a solution for storing and managing large amounts of data within Salesforce. They are ideal for compliance purposes when tracking long-term usage data that will accumulate over time into very large record counts.References: Salesforce Developer Guide - Big Objects
NEW QUESTION # 113
Universal Containers (LIC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.
What should the developer use to ensure the site is multilingual?
- A. Use custom metadata to translate custom picklist values.
- B. Use custom settings to ensure custom messages are translated properly.
- C. Use custom objects to translate custom picklist values.
- D. Use custom labels to ensure custom messages are translated properly.
Answer: D
NEW QUESTION # 114
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller's account number before proceeding with the rest of their call script. Following best practices, what should a developer use to meet this requirement?
- A. Apex Trigger
- B. Flow Builder
- C. Process Builder
- D. Approvals
Answer: B
NEW QUESTION # 115
Which type of controller is best suited when you want to add custom functionality to a standard controller page, or when you want reusable functionality throughout pages?
- A. Custom Controller
- B. Standard List/Set Controller
- C. Standard Controller
- D. Controller Extensions
Answer: D
NEW QUESTION # 116
A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page. Which design resource configuration should be used?
- A.

- B.

- C.

- D.

Answer: C
NEW QUESTION # 117
Consider the below 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
- A.

- B.

- C.

- D.

Answer: C,D
Explanation:
The best practices for writing triggers in Salesforce include bulkifying your code to handle multiple records efficiently and reducing the number of SOQL queries, especially within loops, to avoid hitting governor limits.
Option B is correct because moving the SOQL query outside of the for loop is essential to bulkify the trigger. Performing a query within a loop can cause a SOQL governor limit to be reached if the trigger is processing many records. The best practice is to collect all necessary data before the loop starts and then process it within the loop.
Option C is correct as well, because using a Map to cache the results of a SOQL query by Id is another way to bulkify the code. This allows you to query all the necessary data once and then access it efficiently in memory, avoiding repeated queries.
Option A is incorrect because adding isExecuting before the update doesn't address any best practices related to bulkification or SOQL query optimization.
Option D is incorrect because the last line should not be removed if the developer intends to perform DML on the accountList. However, this line should be outside of the loop and is unnecessary if the trigger context is 'before insert' or 'before update', since in those contexts, changes to records in Trigger.new are implicitly saved without the need for explicit DML.
References:
Apex Developer Guide on Triggers: Triggers and Order of Execution
Salesforce Developer Blog on Trigger Best Practices: Trigger Best Practices
NEW QUESTION # 118
Universal Containers (UC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.
What should the developer use to ensure the site is multilingual?
- A. Use Custom Metadata to translate custom picklist values.
- B. Use Custom Labels to ensure custom messages are translated property.
- C. Use Custom Objects to translate custom picklist values.
- D. Use Custom Settings to ensure custom messages are translated properly.
Answer: B
NEW QUESTION # 119
A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.
The CalloutUtil. makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error. What should be done to address the problem?
- A. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
- B. Change the CalloutUtil.makeRestCallout to an @future method
- C. Move the CalloutUtil.makeRestCallout method call below the catch block.
- D. Remove the Database.setSavepoint and Database.rollback.
Answer: B
NEW QUESTION # 120
A developer has created a solution using the SOAP API for authenticating Communities users. What is needed when issuing the login()Call? Choose 2 answers
- A. Username and Password
- B. Security Token
- C. Organization Id
- D. Session Id
Answer: A,B
NEW QUESTION # 121
Exhibit:
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
- A. Use a Map to cache the results of the Region__c query by Id.
- B. Use a Map accountMap instead of List accountList.
- C. Move the Region__c query to outside the loop.
- D. Remove the last line updating accountList as it is not needed.
Answer: C,D
NEW QUESTION # 122
1 Contact con = new Contact( LastName ='Smith', Department = 'Admin')
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: D
NEW QUESTION # 123
A developer has been asked to create code that will meet the following requirements: Receives input of:
Map<Id, Project__c>, List<Account> Performs a potentially long-running callout to an outside web service Provides a way to confirm that the process executed successfully Which asynchronous feature should be used?
- A. Schedulable interface
- B. @future (callout=true)
- C. Database.AllowsCallouts interface
- D. Queueable interface
Answer: B
NEW QUESTION # 124
A developer recently released functionality to production that performs complex commission calculations in Apex code called from an Opportunity trigger. Users report that the calculations seem incorrect because the values they see for commissions are wrong.
The developer has representative test data in their developer sandbox.
Which three tools or techniques should the developer use to execute the code and pause it at key lines to visually inspect values of various Apex variables?
Choose 3 answers
- A. Developer Console
- B. visual Studio Code
- C. Breakpoints
- D. Workbench
- E. Apex Replay Debugger
Answer: A,B,E
NEW QUESTION # 125
A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created.
Which consideration should be checked to resolve the issue?
- A. Ensure Workflow Rules are inactive.
- B. Ensure the Apex Classes are on the same API version.
- C. Ensure Process Builder processes are inactive.
- D. Ensure the sandbox is on the same release as production.
Answer: D
NEW QUESTION # 126
A developer is asked to develop a new AppExchange application. A feature of the program creates Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the- box AppExchange app needs to come with a set of best practice settings that apply to most customers.
What should the developer use to store and package the custom configuration settings for the app?
- A. Custom Settings
- B. Custom Objects
- C. Custom Metadata
- D. Process Builder
Answer: C
NEW QUESTION # 127
A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
- A. Create a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method.
- B. Create a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method.
- C. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.
- D. Create an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method.
Answer: C
NEW QUESTION # 128
A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of "1" for a: Exec_Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account: trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update) { for (Account accountInstance: Trigger.New) { if (Trigger . isBefore) { accountInstance . Exec_Count_c +=l; System. debug (accountInstance . Exec_Count_c); } } } What is printed from the System.debug statement?
Output from System.debug in every iteration is separated with a delimiter.
- A. 1,2,3,3
- B. 1,2,3,4
- C. 2,2,3,3
- D. 2,2,4,4
Answer: D
NEW QUESTION # 129
A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:
What is causing the code coverage problem?
- A. The account creation already sets the sates amount to 0.
- B. The batch process will not recognize new accounts created in the same session
- C. The executeBatch must fail within test. startTest ( ) and - test. stopTest().
- D. The batch needs more than one account record created.
Answer: C
NEW QUESTION # 130
A developer is asked to look into an issue where a scheduled Apex is running into DML limits. Upon investigation, the developer finds that the number of records processed by the scheduled Apex has recently increased to more than 10,000.
What should the developer do to eliminate the limit exception error?
- A. Use platform events.
- B. Implement the Queueable interface.
- C. Use the @future annotation.
- D. Implement the Bathable interface.
Answer: D
NEW QUESTION # 131
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?
- A. Move the prerequisite reference data setup to the constructor for the test class.
- B. Move the prerequisite reference data setup to a @testSetup method in the test class.
- C. Turn off triggers, flows, and validations when running tests.
- D. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method,
Answer: B
Explanation:
To address the issue of slow unit tests in a test class with many methods that create many records for prerequisite reference data, a developer should move the prerequisite reference data setup to a @testSetup method in the test class. A @testSetup method is a special method that runs once before all test methods in a test class and creates common test data for all test methods. This can improve the performance of the test class by reducing the number of DML operations and avoiding code repetition. The test methods can access the test data created by the @testSetup method by using SOQL queries or the Test.loadData() method. Reference: [@testSetup Annotation], [Create Test Data for Apex Tests], [Test.loadData Method]
NEW QUESTION # 132
Universal Containers is using a custom Salesforce application to manage customer support cases. The support team needs to collaborate with external partners to resolve certain cases. However, they want to control the visibility and access to the cases shared with the external partners. Which Salesforce feature can help achieve this requirement?
- A. Apex managed sharing
- B. Criteria-based sharing rules
- C. Sharing sets
- D. Role hierarchy
Answer: A
Explanation:
Apex managed sharing is the correct feature to control the visibility and access to cases shared with external partners. It allows developers to programmatically create sharing records that grant access to users based on specific criteria, providing granular control over record sharing.References: Apex Developer Guide - Sharing a Record Using Apex
NEW QUESTION # 133
A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity's Probability is greater than 50%. What is the optimal way to automate this?
- A. Build a Process on Opportunity
- B. Create a Workflow on Opportunity.
- C. Build a Flow on Opportunity.
- D. Use an Apex Trigger on Opportunity.
Answer: D
NEW QUESTION # 134
......
PDII dumps review - Professional Quiz Study Materials: https://practicetorrent.exam4pdf.com/PDII-dumps-torrent.html

