Salesforce PDII Online Practice
Questions and Exam Preparation
PDII Exam Details
Exam Code
:PDII
Exam Name
:Salesforce Certified Platform Developer II (Plat-Dev-301)
Certification
:Salesforce Certifications
Vendor
:Salesforce
Total Questions
:445 Q&As
Last Updated
:Jun 19, 2026
Salesforce PDII Online Questions &
Answers
Question 411:
Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
A. Database.insert(records, false) B. Database.insert(records, true) C. insert records D. insert (records, false)
A. Database.insert(records, false)
Question 412:
Which statement is true regarding the use of user input as part of a dynamic SOQL query?
A. Free text input should not be allowed, to avoid SOQL injection B. The String.format() method should be used to prevent injection C. Quotes should be escaped to protect against SOQL injection D. The string should be URL encoded by the input form to prevent errors
C. Quotes should be escaped to protect against SOQL injection
Question 413:
A developer has created a solution using the SOAP API for authenticating Communities users. What is needed when issuing the login() Call? (Choose two.)
A. Organization Id B. Session Id C. Username and Password D. Security Token
A. Organization Id C. Username and Password
Question 414:
Assuming the CreateOneAccount class creates one account and implements the Queuetable interface, which syntax tests the Apex code?
A. List<Account> accts;System.enqueueJob(new CreateOneAccount());Test.getFlexQueueOrder();System.assertEquals(1, accts.size()); B. List<Account> accts;Test.startTest();System.enqueueJob(new CreateOneAccount());Test.stopTest();accts = [SELECT Id FROM Account];System.assertEquals(1, accts.size()); C. List<Account> accts;System.enqueueJob(new CreateOneAccount());Test.startTest();System.assertEquals(1, accts.size());Test.stopTest(); D. List<Account> accts;System.enqueueJob(new CreateOneAccount());accts = [SELECT Id FROM Account];System.assertEquals(1, accts.size());
B. List<Account> accts;Test.startTest();System.enqueueJob(new CreateOneAccount());Test.stopTest();accts = [SELECT Id FROM Account];System.assertEquals(1, accts.size());
Question 415:
An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.
Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?
A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements. B. There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML| statements. C. There will be no error, since the limit on the number of records processed by DML statements is 50,000. D. The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.
A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.
Question 416:
Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called candidate as created with organization-wide default set to Private. A lookup on the Candidate object sets an employee as an Interviewer.
What should be used to automatically give Read access to the record when the lookup field is set to the Interviewer user?
A. The record can be shared using a permission set. B. The record can be shared using a sharing rule. C. The record cannot be shared with the current setup D. The record can be shared an Apex class.
D. The record can be shared an Apex class.
Explanation
In a Private sharing model, record access is restricted to the owner and users above them in the role hierarchy. To grant access to a user identified in a specific field (like a lookup), you need a dynamic sharing mechanism. Apex Managed Sharing (Option D) is the correct choice here because it allows a developer to programmatically create share records based on the value of the lookup field. When the Interviewer lookup is populated, a trigger can insert a record into the Candidate__Share object, granting the specified user 'Read' access.
Sharing rules (Option B) are generally too rigid for this scenario because they typically share records based on a static criteria or ownership, rather than a dynamic lookup to a User. Permission sets (Option A) grant object- level and field-level permissions but do not grant access to specific records that a user does not own in a Private OWD environment. Using Apex provides the necessary automation to ensure that as the interviewer changes, the sharing access is updated in real- time, maintaining a secure but functional interview process.
Question 417:
A developer needs to implement a system audit feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 12 and 24 months old.
Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 12 to 24 month old?
This query requires a specific understanding of how Salesforce handles old records. Salesforce "archives" Tasks that are older than 365 days to maintain performance. These archived records are not returned by standard SOQL queries. To include archived records in a query, the developer must use the ALL ROWS keywords at the end of the query. However, ALL ROWS also returns records that are in the Recycle Bin (deleted records). To satisfy the requirement of "including archived" but "excluding deleted," the developer simply needs to rely on the fact that standard WHERE clause filters apply to the results of ALL ROWS.
Option B is the most accurate. In SOQL, isDeleted=false is implicit unless you are specifically looking for deleted records. The crucial part is the ALL ROWS keyword which brings the archived tasks into scope.
Options A and D are incorrect because isArchived=true would only return the archived tasks and exclude those that are not yet archived. Option C is redundant because isDeleted=false is the default behavior. The syntax => in the prompt options is also technically a typo for >=. Option B represents the standard way to query across the "active" and "archived" boundary while ignoring the Recycle Bin.
Question 418:
Refer to the code segment above.
When following best prachces for writing Apex triggers, which two lines are wrong or cause for concern? (Choose Two)
A. Line 6 B. Line 12 C. Line 16 D. Line 20
A. Line 6 D. Line 20
Question 419:
Universal Container needs to integrate with an external system. Every time an Account record is updated to meet certain criteria, a SOAP message must be sent to a third party end-point with the following information: Name, Industry, AccountNumber, and Rating. The lead developer for the org is considering using Workflow rules instead of Apex triggers to fulfill the above requirements.
What are three benefits of using Workflow rules as opposed to Apex triggers? (Choose three.)
A. A SOAP message can send more than 100 notifications B. Two-way SSL is supported by including a client certificate C. Outbound messages prevent circular changes out-of-the-box D. Retry logic for outbound messages is enabled out-of-the-box E. Tracking outbound message delivery is enabled out-of-the-box
A. A SOAP message can send more than 100 notifications B. Two-way SSL is supported by including a client certificate C. Outbound messages prevent circular changes out-of-the-box
The test method above tests in Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?
A. Add Test.startTest() before and Test.stopTest() after both Line 7 of the code and Line 20 of the code. B. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced. C. Add Test.startTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code. D. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger.
C. Add Test.startTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only Salesforce exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your PDII exam preparations
and Salesforce certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.