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 381:
A developer gets an error saying 'Maximum Trigger Depth Exceeded.' What is a possible reason to get this error message?
A. The SOQL governor limits are being hit. B. A Process Builder is running that sends mass emails. C. Trigger is recursively invoked more than 16 times. D. There are numerous DML operations in the trigger logic.
C. Trigger is recursively invoked more than 16 times.
Question 382:
A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity to be considered high value is an amount greater than or equal to SI,000,000. However, this criteria value can change over time.
There is a new requirement to also display high value opportunities in a Lightning web component.
Which two actions should the developer take to prevent the business logic that obtains the high value opportunities from being repeated in more than one place?
A. Use custom metadata to hold the high value amount. B. Call the trigger from the Lightning web component. C. Leave the business logic code Inside the trigger for efficiency. D. Create a helper class that fetches the high value opportunities.
A. Use custom metadata to hold the high value amount. D. Create a helper class that fetches the high value opportunities.
Explanation
To adhere to the DRY (Don't Repeat Yourself) principle and ensure maintainability, business logic should be decoupled from specific execution contexts like triggers.
Option D is a best practice. By moving the logic into a Service or Helper class , the code becomes reusable. The trigger can call this class during DML operations to flag records, and an Apex controller (invoked by the Lightning Web Component) can call the same class to retrieve the high-value records for display. This ensures that if the criteria for "high-value" changes, the developer only needs to update the code in one location.
Option A complements this by externalizing the "High Value Amount" threshold. Instead of hardcoding a value (e.g., $100,000) within the Apex code, storing it in Custom Metadata allows administrators to adjust the threshold without requiring a code deployment. The helper class can dynamically query this metadata.
Option B is technically impossible; triggers are fired by the database system in response to DML, not called directly by UI components. Option C leads to "Trigger Bloat" and prevents the LWC from accessing the logic, forcing duplication.
Together, A and D provide a scalable, configurable, and reusable architecture.
Question 383:
A developer has written the following method:
static void processList(List<sobject> input){
Which code block can be used to call the method?
A. processList (ace) B. processList ([FIND 'Acme" 'RETURNING Account]) C. processList([SELECT Id, Name FROM sObject WHERE Type = 'Account']) D. for Account ace : [SELECT Id, Name FROM Account])
C. processList([SELECT Id, Name FROM sObject WHERE Type = 'Account'])
Question 384:
Consider the following code snippet, depicting an Aura component:
Which two interfaces can the developer implement to make the component available as a quick action? (Choose two.)
A. Force:lightningQuicAction B. Force:hasRecordId C. Force hasObjectName D. Lightning QuickActionAPI E. Force:lightningQuickActionWithoutHeader
A. Force:lightningQuicAction E. Force:lightningQuickActionWithoutHeader
A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method, getRecentContacts, returns a list of Contacts and will be wired to a property in the component.
Which two lines must change in the above ode to make the Apex method able to be wired? (Choose Two)
A. Add AuraEnanled(cacheabletrue) to the line 08 B. Remove private from line 09. C. Add @AuraEnabled (cacheabletrue) to line 03. D. Add public to line 04.
C. Add @AuraEnabled (cacheabletrue) to line 03. D. Add public to line 04.
Explanation
To expose an Apex method to a Lightning Web Component (LWC) and specifically use the @wire service, the method must meet two strict criteria: it must be public or global, and it must be annotated with @AuraEnabled(cacheable=true). In the provided snippet, line 04 defines the method as static but lacks an access modifier. In Apex, the default access modifier is private, which prevents the LWC framework from accessing the method. Changing line 04 (Option D) makes the method visible to the component.
to public static List<Contact>
Additionally, the @wire service requires the method to be "cacheable" to optimize performance by storing results on the client-side. This is achieved by adding the @AuraEnabled(cacheable=true) annotation. Placing this on line 03 ( Option C ) ensures the method is registered with the Lightning Data Service as an invokable, cacheable action. Modifying line 08 (Option A) is incorrect because that is a private helper method that the component does not call directly. By making the primary method public and cacheable, the LWC can successfully bind its property to the data returned by the Apex controller.
Question 386:
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. B. Create a Process Builder to execute the query and invoke from the Lightning component. C. Invoke an Apex dass with the method annotated as iraEnabled to perform the query. 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.
Question 387:
If the "PageReference.setRedirect" Apex function is set to True, what type of request is made?
A. Get request B. Postback request C. If PageReference points to the same controller and subset of extensions, postback request, otherwise get request
A. Get request
Question 388:
A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as 100,000 Catalog Items.
Both custom objects have a CurrencyIsoCode Text field that contains the currency code they should use. If a Catalog's CurrencyIsoCode changes, all of its Catalog Items' CurrencyIsoCodes should be changed as well.
What should a developer use to update the CurrencIsoCodes on the Catalog Items when the Catalog's CurrencyIsoCode changes?
A. An after insert trigger on Catalog that updates the Catalog Items if the Catalog's CurrencyIsoCode is different. B. An after insert trigger on Catalog Item that updates the Catalog Items if the Catalog's CurrencyIsoCode is different. C. A Database.Schedulable and Database.Batchable class that queries the Catalog object and updates the Catalog Items if the Catalog CurrencyISoCode is different. D. A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencyISoCode is different.
D. A Database.Schedulable and Database.Batchable class that queries the Catalog Item object and updates the Catalog Items if the Catalog CurrencyISoCode is different.
Explanation
The primary challenge in this scenario is the high volume of child records (up to 100,000 Catalog Items) associated with a single parent Catalog. In Salesforce, synchronous transactions like Apex triggers are subject to strict governor limits, most notably the limit of 10,000 DML rows per transaction. If a developer were to use an "after update" trigger on the Catalog object (Option A) to update 100,000 child items, the transaction would immediately fail with a LimitException as soon as it exceeded that threshold.
To handle such a massive update successfully, the developer must use an asynchronous approach, specifically Batch Apex. By implementing Database.Batchable, the platform can process the 100,000 records in smaller chunks (batches), each within its own set of governor limits. Option D is the correct implementation because the Batch class should query the Catalog Item (the child object) where the CurrencyIsoCode does not match the parent Catalog. This targets only the records that need modification.
While Option C suggests batching the parent Catalog, it is more efficient to query the child items directly to ensure every record needing an update is processed across the multiple batches of the execution. This ensures data consistency across the entire 100,000 record set without risking transaction failures.
Question 389:
Consider the following code snippet:
When the component is deployed, an error is reported.
Which two changes should the developer implement in the code to ensure the component deploys successfully? (Choose two.)
A. import getOrders from '@salesforce/apex/OrderController.getAvailableOrders'; B. import { LightningElement, api ) from 'lwc'; C. import getOrders from '@salesforce/apex/c.OrderController.getAvailableOrders'; D. import { LighningElement, wire } from 'lwc';
A. import getOrders from '@salesforce/apex/OrderController.getAvailableOrders'; D. import { LighningElement, wire } from 'lwc';
Question 390:
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 will return a unique list of all the Contact records that have no `Fulfilled' Orders?
A. SELECT Id FROM Contact WHERE Id NOT IN (SELECT Id FROM Order__c WHERE Status__c = `Fulfilled') B. SELECT Contact__c FROM Order__c WHERE Status__c <> `Fulfilled' C. SELECT Id FROM Contact WHERE Id NOT IN (SELECT Contact__c FROM Order__c WHERE Status__c = `Fulfilled') D. SELECT Contact__c FROM Order__c WHERE Id NOT IN (SELECT Id FROM Order__c Where Status__c = `Fulfilled')
D. SELECT Contact__c FROM Order__c WHERE Id NOT IN (SELECT Id FROM Order__c Where Status__c = `Fulfilled')
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.