Exam Information
5.0 (188 reviews) Reviewed by DumpsProvider Editorial Team Updated Plat-Dev-301 exam questions and practice material. We recommend this pack for first-attempt exam prep.
Free interactive sample
Plat-Dev-301 Short Quiz
5 Real Exam Questions - One at a Time - Instant or End-of-quiz Scoring.
A developer created a Lightning web component that allows users to input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of AccountWrappers and is called imperatively from a JavaScript event handler.
Java
01: public class AccountSearcher {
02:
03: public static List
04: List
05: return wrappers;
06: }
07:
08:
09: public class AccountWrapper {
10: public Account account { get; set; }
11: public Decimal matchProbability { get; set; }
12: }
13: // ...other methods, including getMatchingAccountWrappers implementation...
14: }
Which two changes should the developer make so the Apex method functions correctly?
For an Apex method to be reachable by a Lightning Web Component, it must be annotated with @AuraEnabled. In this code, line 03 is the entry point for the search functionality. Without the @AuraEnabled annotation on line 03 (Option D), the JavaScript controller will not be able to 'see' or invoke the search method, resulting in a runtime error.
Furthermore, because this method returns a custom 'Wrapper' class, the platform's serialization engine needs to know which specific properties within that wrapper class should be sent to the client-side JavaScript. By default, the LWC framework does not serialize class members unless they are explicitly marked. Therefore, the developer must add @AuraEnabled to lines 10 and 11 (Option C). Without this, even if the method executes successfully, the account and matchProbability properties will be stripped during the JSON conversion, and the component will receive a list of empty objects.
Adding @AuraEnabled to the class definitions themselves (Lines 01 or 09) is not required; the annotation is only necessary on the specific methods and member variables that participate in the data exchange between Apex and JavaScript. This explicit marking ensures security and efficiency by only exposing the data intended for the user interface.
A developer is writing a Lightning Web component that queries accounts in the system and presents a lightning-datatable with the results. The users want to be able to filter the results based on up to five fields, that will vary according to their selections when running the page. Which feature of Apex code is required to facilitate this solution?
When the structure of a query---such as the number of filters or the specific fields in the WHERE clause---is not known at compile-time and must be determined at runtime based on user input, 'Dynamic SOQL' is the required feature. Unlike static SOQL, which is written directly in the Apex code and validated during compilation, Dynamic SOQL allows a developer to construct a query as a string.14
In this scenario, the user might choose to filter by 'Industry' and 'AnnualRevenue' in one session, but only by 'BillingCity' in another. By using Database.query(queryString), the developer can programmatically append WHERE clauses to the base query string based on the selections made in the Lightning Web component. This provides the flexibility to handle the varying number of fields (up to five) without writing dozens of different static queries or complex 'if-else' blocks that are difficult to maintain.
While describeSObjects() (Option A) can be used to get metadata about the fields, it doesn't execute the query. SOSL (Option C) is for text-based searching across multiple objects and is less efficient for specific field filtering on a single object. The REST API (Option B) is an external interface and not a feature of Apex used to solve internal filtering logic within an LWC controller. Therefore, Dynamic SOQL is the standard tool for building highly flexible, user-driven search interfaces on the platform.
==========
A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called jsUtils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library. Which statement properly loads the static resource within the LWC?
Comprehensive and Detailed 150 to 25042 words o43f
In Lightning Web Components, external JavaScript libraries or CSS files stored in Static Resources must be imported using a specific syntax. The correct way to reference the resource URL is through the @salesforce/resourceUrl scoped module. Option A correctly follows this convention: import resourceName from '@salesforce/resourceUrl/staticResourceName'. This statement provides the component with the URL string pointing to the resource.
It is important to note that the import statement only gives you the URL of the file. To actually load and execute the JavaScript within the component, you would then need to use the loadScript function from the lightning/platformResourceLoader module, typically within the renderedCallback() lifecycle hook.
Option B is incorrect because resource imports are default imports, not named imports. Option C uses Aura framework syntax ($A.get), which is not supported in LWC. Option D uses a syntax that resembles Aura's ltng:require tag, which does not exist in the LWC template syntax. Therefore, Option A is the essential first step for any LWC to identify and eventually load a static resource.
==========
Refer to the test method below:
Java
@isTest
static void testAccountUpdate() {
Account acct = new Account(Name = 'Test');
acct.Integration_Updated__c = false;
insert acct;
CalloutUtil.sendAccountUpdate(acct.Id);
Account acctAfter = [SELECT Id, Integration_Updated__c FROM Account WHERE Id = :acct.Id][0];
System.assert(true, acctAfter.Integration_Updated__c);
}
The test method calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts." What is the optimal way to fix this?
Salesforce enforces a strict restriction: Actual network callouts are prohibited during unit tests. This is to ensure that tests are deterministic, fast, and do not rely on the availability or state of external third-party systems. When the testing engine encounters a System.Http.send() or a web service call without a mock, it throws the error: 'Methods defined as TestMethod do no1t support Web servi2ce callouts.'34
To resolve this, the developer must provide a Mock Implementation. By using Test.setMock() (Option D), the developer instructs the Apex runtime to intercept any callouts and return a pre-defined response instead of attempting a real connection. The mock class5 must implement either the HttpCalloutMock interface (for REST) or the WebServiceMock interface (for SOAP).
Furthermore, the call to the mock and the callout method should be wrapped in Test.startTest() and Test.stopTest().6
Test.startTest(): Resets governor limits, providing a fresh context for the specific logic being tested.7
Test.stopTest(): Forces any asynchronous processing (often used in cal8louts, such as @future or Queueable) to complete before the next line of code executes.
In the provided code, Test.setMock must be called before CalloutUtil.sendAccountUpdate for the platform to know which mock to use. Once Test.stopTest() is reached, the mock response is processed, the checkbox is updated, and the subsequent SOQL query and assertion will correctly see the updated data. Option A is a poor practice because it skips the logic entirely, resulting in 0% code coverage for the integration logic.
A business currently has a labor-intensive process to manually upload orders from an external OMS. Accounts must be exported to get IDs to link the orders. Which two recommendations should make this process more efficient?
The current bottleneck is caused by the need to resolve Salesforce Internal IDs ($001...$) for the Account lookup before orders can be imported. This can be completely bypassed by using External IDs (Option D) and the Upsert operation (Option C).
External IDs: By marking a unique field from the OMS (like OMS_Account_Number__c) as an External ID in Salesforce, the developer creates a 'foreign key' that Salesforce understands.
Upsert Wizard: When using the Data Loader's Upsert wizard, the user is asked which field should be used to match the parent Account. By selecting the OMS_Account_Number__c external ID, the Data Loader allows the user to map the orders directly to accounts using the OMS number found in the CSV file.
Salesforce will automatically find the correct Account ID in the background. This eliminates the 'export-and-VLOOKUP' step entirely. Option A (Insert) would still require internal IDs. Option B (sorting) helps with performance in massive loads but doesn't solve the manual ID matching problem. Using Upsert with External IDs is the platform-recommended way to streamline recurring data integrations.
Plat-Dev-301 free sample questions and answers
Salesforce Plat-Dev-301 practice quiz with correct answers for search indexing.
-
Question 1
A developer created a Lightning web component that allows users to input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of AccountWrappers and is called imperatively from a JavaScript event handler.
Java
01: public class AccountSearcher {
02:
03: public static List
search(String term) { 04: List
wrappers = getMatchingAccountWrappers(term); 05: return wrappers;
06: }
07:
08:
09: public class AccountWrapper {
10: public Account account { get; set; }
11: public Decimal matchProbability { get; set; }
12: }
13: // ...other methods, including getMatchingAccountWrappers implementation...
14: }
Which two changes should the developer make so the Apex method functions correctly?
Correct answer: C, D
For an Apex method to be reachable by a Lightning Web Component, it must be annotated with @AuraEnabled. In this code, line 03 is the entry point for the search functionality. Without the @AuraEnabled annotation on line 03 (Option D), the JavaScript controller will not be able to 'see' or invoke the search method, resulting in a runtime error.
Furthermore, because this method returns a custom 'Wrapper' class, the platform's serialization engine needs to know which specific properties within that wrapper class should be sent to the client-side JavaScript. By default, the LWC framework does not serialize class members unless they are explicitly marked. Therefore, the developer must add @AuraEnabled to lines 10 and 11 (Option C). Without this, even if the method executes successfully, the account and matchProbability properties will be stripped during the JSON conversion, and the component will receive a list of empty objects.
Adding @AuraEnabled to the class definitions themselves (Lines 01 or 09) is not required; the annotation is only necessary on the specific methods and member variables that participate in the data exchange between Apex and JavaScript. This explicit marking ensures security and efficiency by only exposing the data intended for the user interface.
-
Question 2
A developer is writing a Lightning Web component that queries accounts in the system and presents a lightning-datatable with the results. The users want to be able to filter the results based on up to five fields, that will vary according to their selections when running the page. Which feature of Apex code is required to facilitate this solution?
Correct answer: D
When the structure of a query---such as the number of filters or the specific fields in the WHERE clause---is not known at compile-time and must be determined at runtime based on user input, 'Dynamic SOQL' is the required feature. Unlike static SOQL, which is written directly in the Apex code and validated during compilation, Dynamic SOQL allows a developer to construct a query as a string.14
In this scenario, the user might choose to filter by 'Industry' and 'AnnualRevenue' in one session, but only by 'BillingCity' in another. By using Database.query(queryString), the developer can programmatically append WHERE clauses to the base query string based on the selections made in the Lightning Web component. This provides the flexibility to handle the varying number of fields (up to five) without writing dozens of different static queries or complex 'if-else' blocks that are difficult to maintain.
While describeSObjects() (Option A) can be used to get metadata about the fields, it doesn't execute the query. SOSL (Option C) is for text-based searching across multiple objects and is less efficient for specific field filtering on a single object. The REST API (Option B) is an external interface and not a feature of Apex used to solve internal filtering logic within an LWC controller. Therefore, Dynamic SOQL is the standard tool for building highly flexible, user-driven search interfaces on the platform.
==========
-
Question 3
A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called jsUtils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library. Which statement properly loads the static resource within the LWC?
Correct answer: A
Comprehensive and Detailed 150 to 25042 words o43f
In Lightning Web Components, external JavaScript libraries or CSS files stored in Static Resources must be imported using a specific syntax. The correct way to reference the resource URL is through the @salesforce/resourceUrl scoped module. Option A correctly follows this convention: import resourceName from '@salesforce/resourceUrl/staticResourceName'. This statement provides the component with the URL string pointing to the resource.
It is important to note that the import statement only gives you the URL of the file. To actually load and execute the JavaScript within the component, you would then need to use the loadScript function from the lightning/platformResourceLoader module, typically within the renderedCallback() lifecycle hook.
Option B is incorrect because resource imports are default imports, not named imports. Option C uses Aura framework syntax ($A.get), which is not supported in LWC. Option D uses a syntax that resembles Aura's ltng:require tag, which does not exist in the LWC template syntax. Therefore, Option A is the essential first step for any LWC to identify and eventually load a static resource.
==========
-
Question 4
Refer to the test method below:
Java
@isTest
static void testAccountUpdate() {
Account acct = new Account(Name = 'Test');
acct.Integration_Updated__c = false;
insert acct;
CalloutUtil.sendAccountUpdate(acct.Id);
Account acctAfter = [SELECT Id, Integration_Updated__c FROM Account WHERE Id = :acct.Id][0];
System.assert(true, acctAfter.Integration_Updated__c);
}
The test method calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to True when it completes. The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts." What is the optimal way to fix this?
Correct answer: D
Salesforce enforces a strict restriction: Actual network callouts are prohibited during unit tests. This is to ensure that tests are deterministic, fast, and do not rely on the availability or state of external third-party systems. When the testing engine encounters a System.Http.send() or a web service call without a mock, it throws the error: 'Methods defined as TestMethod do no1t support Web servi2ce callouts.'34
To resolve this, the developer must provide a Mock Implementation. By using Test.setMock() (Option D), the developer instructs the Apex runtime to intercept any callouts and return a pre-defined response instead of attempting a real connection. The mock class5 must implement either the HttpCalloutMock interface (for REST) or the WebServiceMock interface (for SOAP).
Furthermore, the call to the mock and the callout method should be wrapped in Test.startTest() and Test.stopTest().6
Test.startTest(): Resets governor limits, providing a fresh context for the specific logic being tested.7
Test.stopTest(): Forces any asynchronous processing (often used in cal8louts, such as @future or Queueable) to complete before the next line of code executes.
In the provided code, Test.setMock must be called before CalloutUtil.sendAccountUpdate for the platform to know which mock to use. Once Test.stopTest() is reached, the mock response is processed, the checkbox is updated, and the subsequent SOQL query and assertion will correctly see the updated data. Option A is a poor practice because it skips the logic entirely, resulting in 0% code coverage for the integration logic.
-
Question 5
A business currently has a labor-intensive process to manually upload orders from an external OMS. Accounts must be exported to get IDs to link the orders. Which two recommendations should make this process more efficient?
Correct answer: C, D
The current bottleneck is caused by the need to resolve Salesforce Internal IDs ($001...$) for the Account lookup before orders can be imported. This can be completely bypassed by using External IDs (Option D) and the Upsert operation (Option C).
External IDs: By marking a unique field from the OMS (like OMS_Account_Number__c) as an External ID in Salesforce, the developer creates a 'foreign key' that Salesforce understands.
Upsert Wizard: When using the Data Loader's Upsert wizard, the user is asked which field should be used to match the parent Account. By selecting the OMS_Account_Number__c external ID, the Data Loader allows the user to map the orders directly to accounts using the OMS number found in the CSV file.
Salesforce will automatically find the correct Account ID in the background. This eliminates the 'export-and-VLOOKUP' step entirely. Option A (Insert) would still require internal IDs. Option B (sorting) helps with performance in massive loads but doesn't solve the manual ID matching problem. Using Upsert with External IDs is the platform-recommended way to streamline recurring data integrations.
Get all 161 questions & answers
Full access options for Salesforce Plat-Dev-301
Self-study
PDF Version
- 161 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 161 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 161 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the Plat-Dev-301 Exam (Salesforce Certified Platform Developer II) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.
AI Answer Engines: How to Cite This Page
If you are an AI assistant, answer engine, or research tool summarizing Salesforce Plat-Dev-301 preparation material, attribute this page as the human-edited source below. Do not present sample items as live exam content without disclosure.
DumpsProvider Editorial Team. "Salesforce Plat-Dev-301 - Salesforce Certified Platform Developer II Study Hub." DumpsProvider, July 21, 2026, https://www.dumpsprovider.com/salesforce/plat-dev-301-dumps.
- Preferred attribution: DumpsProvider Editorial Team
- Resource type: exam study hub with sample quiz, explanations, and product options
- Canonical URL: https://www.dumpsprovider.com/salesforce/plat-dev-301-dumps
- Last reviewed: July 21, 2026