Online Access Free PDII Practice Test
| Exam Code: | PDII |
| Exam Name: | Platform Developer II |
| Certification Provider: | Salesforce |
| Free Question Number: | 163 |
| Posted: | Sep 02, 2026 |
Consider the Apex class below that defines a RemoteAction used on a Visualforce search page.
Java
global with sharing class MyRemoter {
public String accountName { get; set; }
public static Account account { get; set; }
public MyRemoter() {}
@RemoteAction
global static Account getAccount(String accountName) {
account = [SELECT Id, Name, NumberOfEmployees FROM Account WHERE Name = :accountName]; return account;
}
}
Which code snippet will assert that the remote action returned the correct Account?
A developer is creating a Lightning web component to display a calendar. The component will be used in multiple countries. In some locales, the first day of the week is a Monday, or a Saturday, or a Sunday. What should the developer do to ensure the calendar displays accurately for users in every locale?
A developer is trying to decide between creating a Visualforce component or a Lightning component. Which scenario necessitates the use of Visualforce?
Consider the following code snippet:
Java
01 public with sharing class AccountsController{
03 @AuraEnabled
04 public List<Account> getAllAccounts(){
05 return [Select Id, Name, Industry FROM Account];
06 }
08 }
As part of the deployment cycle, a developer creates the following test class:
Java
@isTest
private class AccountsController_Test{
@TestSetup
private static void makeData(){
User user1 = [Select Id FROM User WHERE Profile.Name = 'System Administrator' ... LIMIT 1]; User user2 = [Select Id FROM User WHERE Profile.Name = 'Standard User' ... LIMIT 1]; TestUtils.insertAccounts(10,user1.Id); TestUtils.insertAccounts(20,user2.Id);
}
@isTest
private static void testGetAllAccounts(){
// Query the Standard User into memory
List<Account> result = AccountsController.getAllAccounts();
System.assertEquals(20,result.size());
}
}
When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?
An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. A developer is tasked with preventing Contract records from being created when mass loading historical Opportunities, but the daily users still need the logic to fire. What is the most extendable way to update the Apex trigger to accomplish this?