Salesforce PDII Exam (page: 4)
Salesforce Certified Platform Developer II
Updated on: 25-Dec-2025

Viewing Page 4 of 86

A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to 'Customer' should have a status of 'Active', and Accounts with the type set to 'Prospect' should have a status of 'Pending'. No other changes to data should be made.
Which code block will accurately meet the business requirements?

  1. Map<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'}
    List<Account> accountUpdates = new List<Account>();
    for ( Account a : [SELECT Id, Type FROM Account]){
    if ( statusMap.containsKey(a.Type) ) {
    a.Status = a.Type == 'Customer' ? 'Active' : 'Pending';
    }
    accountUpdates.add(a);
    }
    update accountUpdates;
  2. Map<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'}
    List<Account> accountUpdates = new List<Account>();
    for ( Account a : [SELECT Id, Type FROM Account WHERE Status IN :statusMap.keySet()]){
    a.Status = statusMap.get(a.Type);
    accountUpdates.add(a);
    }
    update accountUpdates;
  3. List<Account> accountUpdates = new List<Account>();
    for ( Account a : [SELECT Id, Type FROM Account]){
    if ( String.isNotBlank(a.Type) && a.Type == 'Customer' ){
    a.Status = 'Active';
    }
    if ( String.isNotBlank(a.Type) && a.Type == 'Prospect' ){
    a.Status = 'Pending';
    }
    accountUpdates.add(a);
    }
    update accountUpdades;
  4. List<Account> accountUpdates = new List<Account>();
    for ( Account a : [SELECT Id, Type FROM Account]){
    a.Status = a.Type == 'Customer' ? 'Active' : 'Pending';
    accountUpdates.add(a);
    }
    update accountUpdates;

Answer(s): C



What is a benefit of JavaScript remoting over Visualforce Remote Objects?

  1. Allows for specified re-render targets
  2. Does not require any Apex code
  3. Does not require any JavaScript code
  4. Supports complex server-side application logic

Answer(s): D



A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available.
What change should be applied to the component?

  1. Expose it in the markup using the implements and access attributes.
  2. Delete the component, metadata, and Apex controller and recreate them.
  3. Refresh the sandbox and upgrade it to the latest API version.
  4. Look for errors in the logic in the JavaScript controller.

Answer(s): A



Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce.

The flow of data is as follows:

-The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
-If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
-If a match is not found, the integration will create a Lead and a Task for that newly created Lead.

What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?

  1. Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period.
  2. Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing.
  3. Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing.
  4. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.

Answer(s): C



A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page.

Which design resource configuration should be used?

  1. <design:component label="Account FS Component">
    <design:attribute name="fieldSetName" Label="Field Set Name" />
    <sfdc:objects>
    <sfdc:object>FieldSet</sfdc:object>
    </sfdc:objects>
    </design:component>
  2. <design:component label="Account FS Component">
    <design:attribute name="fieldSetName" label="Field Set Name" />
    <sfdc:objects>
    <sfdc:object>Account</sfdc:object>
    </sfdc:objects>
    </design:component>
  3. <design:component label="Account FS Component">
    <aura:attribute name="fieldSetName" label="Field Set Name" />
    <sfdc:objects>
    <sfdc:object>FieldSet</sfdc:object>
    </sfdc:objects>
    </design:component>
  4. <design:component label="Account FS Component">
    <aura:attribute name="fieldSetName" label="Field Set Name" />
    <sfdc:objects>
    <sfdc:object>Account</sfdc:object>
    </sfdc:objects>
    </design:component>

Answer(s): B



Viewing Page 4 of 86



Share your comments for Salesforce PDII exam with other users:

Farooqi 11/21/2023 1:37:00 AM

good for practice.
INDIA