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 371:
Which annotation should a developer use on an Apex method to make it available to be wired to a property In a Lightning web component?
A. @RemoteAction B. @AuraEnabledcacheable=true) C. @QRemoteAction(caccheable=true) D. @AuraEnabled
B. @AuraEnabledcacheable=true)
Question 372:
A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price.
What must be added to display the total?
A. Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template. B. Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template. C. Add Total: {quantity * UnitPrice} in the template. D. Add Total; {multiple quantit,y unitprice)} in the template.
B. Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template.
Question 373:
The "Webservice" keyword___________.
A. Method must be static, and class must be global B. Can be used on all classes C. Used for any member variables included D. All of the above
D. All of the above
Question 374:
Exhibit.
public class LeadController {
public static List<Lead> getFetchLeadList(String searchTerm, Decimal aRevenue) {
A developer created a JavaScript function as part of a Lightning Web Component (LWC) that surfaces information about leads by imperatively calling getFetchLeadList when certain criteria are met.
What are the changes the developer should implement in the Apex class above to ensure the LWC can display data efficiently while preserving security? (Choose three)
A. Annotate the Apex method with @AuraEnabled. B. Annotate the Apex method with @AuraEnabled(cacheable=true). C. Use the WITH SECURITY_ENFORCED clause within the SOQL query. D. Implement the with sharing keyword in the class declaration. E. Implement the without sharing keyword in the class declaration.
B. Annotate the Apex method with @AuraEnabled(cacheable=true). C. Use the WITH SECURITY_ENFORCED clause within the SOQL query. D. Implement the with sharing keyword in the class declaration.
Explanation
To make an Apex method compatible with a Lightning Web Component's @wire service and ensure it follows security best practices, three specific modifications are required:
@AuraEnabled(Cacheable=true) (Option B): The @wire service in LWC requires the Apex method to be marked as cacheable. This enables client-side caching via the Lightning Data Service, which significantly improves UI performance by reducing redundant server calls. Note that Cacheable=true is mandatory for @wire but optional for imperative calls.
with sharing (Option D): In Apex, classes do not enforce sharing rules by default. To ensure the user only sees Leads they have access to according to the organization-wide defaults and sharing model, the class must explicitly use the with sharing keyword.
WITH SECURITY_ENFORCED (Option C): While with sharing handles record-level access, it does not automatically enforce field-level security (FLS) or object-level security (CRUD). Adding the WITH SECURITY_ENFORCED clause to the SOQL query ensures that if a user does not have permission to view the AnnualRevenue field, the query will throw an exception rather than exposing protected data.
Options A and E are incorrect because without sharing bypasses security, and a simple @AuraEnabled without cacheable=true is insufficient for the LWC @wire service.
Question 375:
What are three benefits of using static resources in Visualforce and Lightning Components? (Choose Three)
A. Static resource files can be packaged into a collection of related files in a zip or jar archive. B. Static resource files do not count against an organization's quota of data storage. C. Static resource files are automatically minified. D. Relative paths can be used in files in static resource archives to refer to other content within the archive. E. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
A. Static resource files can be packaged into a collection of related files in a zip or jar archive. D. Relative paths can be used in files in static resource archives to refer to other content within the archive. E. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
Question 376:
Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Numberc and ERP_Keyc.
Which two queries are optimized for large data volumes? (Choose two.)
A. SELECT Id FROM Account WHERE Id IN :aListVariable B. SELECT Id FROM Account WHERE Name != '' AND IsDeleted = false C. SELECT Id FROM Account WHERE Name != NULL D. SELECT Id FROM Account WHERE Name != '' AND Customer_Numberc = 'ValueA'
A. SELECT Id FROM Account WHERE Id IN :aListVariable D. SELECT Id FROM Account WHERE Name != '' AND Customer_Numberc = 'ValueA'
Explanation
When querying Large Data Volumes (LDV), Salesforce relies on the Query Optimizer to decide whether an index can be used. A query is considered optimized or selective if it uses an indexed field in the WHERE clause and filters the result set below a specific threshold (typically 10% of the first million records).
Option A is optimized because it filters by the Id field using the IN operator. The Id field is the primary key and is always indexed. Filtering by a collection of IDs is one of the most efficient ways to retrieve records in a large data volume environment.
Option D is optimized because it filters on Customer_Number__c, which is marked as an External ID. Salesforce automatically creates a custom index for any field marked as an External ID or Unique. Even though the query also includes a non-selective filter (Name != ''), the presence of the indexed External ID field allows the optimizer to perform an index scan rather than a full table scan.
Options B and C are not optimized. IsDeleted is not an indexed field, and the Query Optimizer generally ignores IsDeleted = false filters when calculating selectivity. Filtering for Name != NULL or Name != '' (Option C) is considered a negative filter and typically results in a full table scan because it does not narrow the search results enough to efficiently utilize an index.
Question 377:
A company wants to create a dynamic survey that navigates users through a different series of questions based on their previous responses.
What is the recommended solution to meet this requirement?
A. Dynamic Record Choice B. Lightning Process Builder C. Visualforce and Apex D. Custom Lightning Application
A. Dynamic Record Choice
Question 378:
What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records B. Test methods must call the batch execute() method once C. Test methods must use the @isTest (SeeAllData=true) annotation D. Test methods must run the batch between Test.startTest() and Test.stopTest()
B. Test methods must call the batch execute() method once D. Test methods must run the batch between Test.startTest() and Test.stopTest()
Question 379:
A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly.
What will improve performance? (Choose three.)
A. Reducing the view state B. Using actionRegion and rerender C. Turning off the standard stylesheet D. Setting the Apex Page attribute cache=true E. Using selective queries
A. Reducing the view state D. Setting the Apex Page attribute cache=true E. Using selective queries
Question 380:
A developer created the code to perform an HTP GET request to an external system.
public class ERPCatalog {
private final String ERP_CATALOG_URL = 'http://sampleCatalog.com/cat';
public String getERPCatalogContents() { Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(ERP_CATALOG_URL);
req.setMethod('GET');
HttpResponse res = h.send(req);
return res.getBody();
}
}
When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:System.CalloutException: Unauthorized endpoint
Which recommended approach should the developer implement to the callout exception?
A. create a remote site setting configuration that includes the endpoint. B. Annotate the getERPCatalogContents method With @Future (Callout-true) C. use the setHeader () method to specify Basic Authentication. D. Change the access modifier for ERPCatelog from Public to global
D. Change the access modifier for ERPCatelog from Public to global
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.