Start your PDII Exam Questions Preparation with Updated 204 Questions [Q35-Q56]

Share

Start your PDII Exam Questions Preparation with Updated 204 Questions

A Fully Updated 2026 PDII Exam Dumps - PDF Questions and Testing Engine


Salesforce PDII certification exam consists of 60 multiple-choice questions, which must be answered within a time limit of 120 minutes. PDII exam covers a wide range of topics, including Apex programming, Visualforce, Lightning Components, integration with external systems, and deployment strategies. PDII exam is designed to test the candidate's ability to develop scalable and robust applications on the Salesforce platform.


Salesforce PDII certification is a great way for developers to demonstrate their advanced skills and knowledge in building custom applications on the Salesforce platform. With this certification, developers have the opportunity to advance their careers and open up new job opportunities in the Salesforce ecosystem.

 

NEW QUESTION # 35
Choose the correct definition for <apex:actionFunction>

  • A. Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and shows content conditionally depending on the status of the request (in progress/complete). Use the "id" field to specify name; use "status" field on related components to connect them
  • B. Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.)
  • C. Sends an AJAX request according to the time interval you specify. If this ever gets re-rendered, it resets
  • D. Signifies which components should be processed by the server when an AJAX request is generated
  • E. Allows for controller methods to be called directly from Javascript. Must be encapsulated in tags. Unlike actionSupport, these functions can be called directly from Javascript code

Answer: E


NEW QUESTION # 36
An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.
What is the optimal way to implement this?

  • A. Apex triggers on Contact and Account that normalize the address
  • B. Apex trigger on Contact that calls the Account trigger to normalize the address
  • C. Apex trigger on Account that calls the Contact trigger to normalize the address
  • D. Apex triggers on Contact and Account that call a helper class to normalize the address

Answer: B


NEW QUESTION # 37
A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

  • A. Use the asyncSend() method of the HTTP class to send the request in async context
  • B. Ensure all callouts are completed prior to executing DML statements
  • C. Move the web service callout into an ©future method
  • D. Use Database.insert (order, true) to immediately commit any database changes

Answer: B,C


NEW QUESTION # 38
A developer wrote a test class that successfully asserts a trigger on Account, It fires and updates data correctly In a sandbox environment.
A Salesforce admin with a custom profile attempts to deploy this trigger via a change set into the production environment, but the test class falls with an Insufficient privileges error.
What should a developer do to fix the problem?

  • A. Add System.runAs() to the test class to execute the trigger as a user with the correct object permissions.
  • B. Verify that Test. startTest() Is not Inside a For loop in the test class,
  • C. Configure the production environment to enable
    "Run All Tests as Admin User."
  • D. Add seeallData=true to the test class to work within the sharing model for the production environment.

Answer: A

Explanation:
When a test class fails with an "Insufficient privileges" error during deployment, it indicates that the user profile under which the tests are being executed doesn't have the necessary permissions to perform the actions required by the test. In a sandbox, the test might have been running with a different set of permissions compared to the production environment.
By using System.runAs(), you can specify a user context in which the test should run, which allows you to simulate the appropriate permissions. For this to work, you need to create a User instance in your test class with the profile that has the necessary permissions and then enclose the logic of your test within a System.runAs() block with this user.
This is a preferred solution over seeAllData=true, which would give the test access to all data in the production environment, potentially leading to tests that are not isolated and thus less reliable. It's also preferred over changing organization-wide settings or relying on specific setup in test classes, such as making sure Test.startTest() is not inside a loop.
References:
Salesforce Documentation on Using the runAs Method: Testing with the runAs Method Salesforce Help Article on System Permissions: Profiles and Permissions


NEW QUESTION # 39
As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout.
Which two elements should the developer use to implement these business requirements?
Choose 2 answers

  • A. Process Builder
  • B. Apex method that returns a Continuation object
  • C. Lightning web component
  • D. Screen now

Answer: B,C


NEW QUESTION # 40
Universal Containers analyzes a Lightning web component and its Apex controller class that retrieves a list of contacts associated with an account. The code snippets are as follows:

Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?

  • A. Modify the SOQL query in the getAccountContacts method to include the MailingAddress field and update the columns attribute in javascript file to add Mailing address fields.
  • B. Extend the lightning-datatable component in the Lightning web component to include a column for the MailingAddress field.
  • C. Add a new method in the Apex controller class to retneve the mailing addresses separately and modify the Lightning web component to invoke this method.
  • D. Modify the SOQL guery in the getAccountContacts method to include the MailingAddress field.

Answer: D


NEW QUESTION # 41
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?

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

Answer: C


NEW QUESTION # 42
An Aura component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.

How should a developer change the component to be responsive for mobile and tablet devices?

  • A.
  • B.
  • C.
  • D.

Answer: D


NEW QUESTION # 43
Refer to the markup below:

A Lightning web component displays the Account name and two custom fields out of
275 that exist on the abject. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?

  • A. Add density="compat" to the component.
  • B. Replace Layout-type =''Full1" with Layout-type="Partial".
  • C. Replace layout-type =''1" with fields=(fields}.
  • D. Add cache="true" to the component.

Answer: C


NEW QUESTION # 44
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production. What should the developer ensure to correct these errors?

  • A. Ensure properties are marked as private.
  • B. Ensure queries do not exceed governor limits.
  • C. Ensure profiles have access to the Visualforce page.
  • D. Ensure variables are marked as Transient.

Answer: D


NEW QUESTION # 45
What is the transaction limit on the number of "sendEmail" method calls?

  • A. 0
  • B. 1
  • C. 2
  • D. There is no limit
  • E. 3

Answer: E

Explanation:
/Reference:
The reserveEmailCapacity methods let you declare how many emails you want to send prior to actually sending, allowing you to handle limit errors prematurely


NEW QUESTION # 46
A developer is working with existing functionality that tracks how many times a stage has changed for an Opportunity. When the Opportunity's stage is changed, a workflow rule is fired to increase the value of a field by one. The developer wrote an after trigger to create a child record when the field changes from 4 to 5.
A user changes the stage of an Opportunity and manually sets the count field to 4. The count field updates to 5, but the child record is not created.
What is the reason this is happening?

  • A. After triggers are not fired after field updates.
  • B. Trigger.old does not contain the updated value of the count field.
  • C. After triggers fire before workflow rules.
  • D. Trigger.new does not change after a field update.

Answer: B

Explanation:
The reason this is happening is that Trigger.old does not contain the updated value of the count field. Trigger.old is a list of the old versions of the sObject records, before any changes were made in the trigger. Trigger.new is a list of the new versions of the sObject records, after any changes were made in the trigger. In this case, the workflow rule is fired after the trigger, and updates the count field from 4 to 5. However, the trigger does not see this change, as it only compares the values in Trigger.old and Trigger.new, which are both 4. To fix this, the developer should use an after update trigger, and re-query the updated records to get the latest values of the count field. After triggers fire before workflow rules is incorrect, as workflow rules fire after triggers. Trigger.new does not change after a field update is incorrect, as Trigger.new does change after a field update, but only within the same trigger context. After triggers are not fired after field updates is incorrect, as after triggers are fired after field updates, unless the field updates are made by a workflow rule or a process. Reference: [Triggers and Order of Execution], [Trigger Context Variables], [Apex Developer Guide]


NEW QUESTION # 47
Given the following code, what value Will be output in the logs by line #8? 1 Contact con = new Contact( LastName ='Smith', Department = 'Admin') 2 insert con; 3 Contact insertedContact=[select Name from Contact where id=zcon.Id]; 4 Savepoint sp_admin = Database.setSavepoint(); 5 con.Department = 'HR'; D} 6 update con; 7 Database.rollback(sp_admin); 8 console.log(Limits.getDmlStatements());

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: C


NEW QUESTION # 48
A developer is tasked with creating a Lightning web component that is responsive on various devices.
Which two components should help accomplish this goal?
Choose 2 answers

  • A. Lightning-iayout
  • B. Lightning-input-location
  • C. Lightning-layout-item
  • D. Lightning-navigation

Answer: A,C


NEW QUESTION # 49
Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations.
When a customer service agent enters the credit card information, it must be sent to 8 3rd-party payment processor for the donation to be processed, UC uses one payment processor for individuals and a different one for corporations.
What should a developer use to store the payment processor settings for the different payment processors, so that their system administrator can modify the settings once they are deployed, if needed?

  • A. Custom metadata
  • B. List custom setting
  • C. Hierarchy custom setting
  • D. Custom object

Answer: A

Explanation:
Custom metadata types are ideal for storing payment processor settings that need to be changed by an administrator post-deployment. They can be deployed with managed packages and are upgradeable. Unlike Custom Objects, Custom Metadata Types also support a deployment with active data and can have their records retrieved via SOQL in Apex.References: Salesforce Help - Custom Metadata Types Overview


NEW QUESTION # 50
The Salesforce admin at Cloud Kicks created a custom object called Region__c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to.

Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.
A)

B)


D)

  • A. Option D
  • B. Option B
  • C. Option C
  • D. Option A

Answer: D


NEW QUESTION # 51
What is the optimal way to fix this?

  • A.
  • B.
  • C.
  • D.

Answer: D

Explanation:
Test.startTest() and Test.stopTest() should wrap the method call for resource allocation. Test.setMock() sets a mock callout for the test to handle callouts.References: Apex Developer Guide - Testing HTTP Callouts


NEW QUESTION # 52
A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case.

What could be the cause of this issue?

  • A. A workflow rule is firing with a Field Update action
  • B. A workflow rule is firing with a Create Task action
  • C. A user is editing the record multiple times
  • D. A user is creating the record as Closed

Answer: C


NEW QUESTION # 53
Universal Containers analyzes a Lightning web component and its Apex controller class that retrieves a list of contacts associated with an account. The code snippets are as follows:

Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?

  • A. Modify the SOQL query in the getAccountContacts method to include the MailingAddress field and update the columns attribute in javascript file to add Mailing address fields.
  • B. Extend the lightning-datatable component in the Lightning web component to include a column for the MailingAddress field.
  • C. Add a new method in the Apex controller class to retneve the mailing addresses separately and modify the Lightning web component to invoke this method.
  • D. Modify the SOQL guery in the getAccountContacts method to include the MailingAddress field.

Answer: A

Explanation:
To display the contacts' mailing addresses in the Lightning web component, both the SOQL query in the getAccountContacts method and the columns attribute in the JavaScript file of the component need to be updated. The query must include the MailingAddress field, and the JavaScript file must be modified to add this field to the columns shown in the lightning-datatable.
References: Lightning Web Components Developer Guide - lightning-datatable


NEW QUESTION # 54
What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)
<apex:commandFunction action="{!Save}" value="Save" rendered="thePageBlock"/>

  • A. <apex:actionSupport action="{!Save} " event="onchange"
  • B. <apex:commandButton action="{!Save}" value="Save" redraw="thePageBlock"/>
  • C. rerender="thePageBlock"/>
  • D. <apex:actionFunction action="{!Save}" name="Save" rerender="thePageBlock"/>

Answer: B,C

Explanation:
Explanation


NEW QUESTION # 55
A developer creates a Lightning web component to allow a Contact to be quickly entered- However, error messages are not displayed.

Which component should the developer add to the form to display error messages?

  • A. lightning-messages
  • B. apex:messages
  • C. lightning-error
  • D. aura:messages

Answer: A


NEW QUESTION # 56
......


Salesforce PDII certification is a challenging but rewarding certification for the Salesforce developers who want to demonstrate their knowledge and expertise in designing and developing advanced custom applications using the Salesforce platform. It is a valuable asset for any developer who wants to advance their career in the Salesforce ecosystem. With its global recognition and high demand in the industry, the PDII certification is a must-have for any serious Salesforce developer.

 

Easy Success Salesforce PDII Exam in First Try: https://actualtests.trainingquiz.com/PDII-training-materials.html