[Aug 27, 2026] PDII PDF Dumps is essential on your PDII Exam Questions Certain Success!
PDII PDF Questions - Perfect Prospect To Go With PDII Practice Exam
NEW QUESTION # 90
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. rerender="thePageBlock"/>
- B. <apex:commandButton action="{!Save}" value="Save" redraw="thePageBlock"/>
- C. <apex:actionFunction action="{!Save}" name="Save" rerender="thePageBlock"/>
- D. <apex:actionSupport action="{!Save} " event="onchange"
Answer: A,B
NEW QUESTION # 91
A page throws an 'Attempt to dereference a null object' error for a Contact.
What change in the controller will fix the error?
- A. Declare a static final Contact at the top of the controller.
- B. Use a condition in the getter to return a new Contact if it is null.
G Change the setter's signature to return a Contact. - C. Change the getter's signature to be static Contact.
Answer: B
Explanation:
The error 'Attempt to dereference a null object' often occurs when trying to access a member of a null object.
By checking if the object is null in the getter method and returning a new instance if it is, the error can be prevented.
References:
Apex Developer Guide
NEW QUESTION # 92
What Salesforce tool lets you deploy/retrieve metadata, check status of apex jobs, and check responses of REST calls?
- A. Workbench
- B. Developer Console
- C. Streaming API
- D. Force.com Migration Tool
Answer: A
NEW QUESTION # 93
A managed package uses a list of country ISO codes and country names as references data in many different places.. managed package Apex code.
What is the optimal way to store and retrieve the list?
- A. Store the information in Custom Metadata and access it with the getAll() method.
- B. Store the information in a list Custom Setting and access it with the getAll() method
- C. Store the information in Custom Metadata and query it with SOQL.
- D. Store the information in a List Custom Setting and query it with SOQL.
Answer: C
NEW QUESTION # 94
A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met. What is the optimal way to accomplish this?
- A. Use an Email Alert with Flow Builder.
- B. Use an Apex trigger with Batch Apex.
- C. Use SingleEmailMessage() with an Apex trigger.
- D. Use MassEmailMessage() with an Apex trigger.
Answer: A
Explanation:
For high-volume, automated standard email communications, Email Alerts with Flow Builder (Option B) is the most scalable and maintainable solution. Salesforce imposes strict limits on the number of "Single" emails sent via Apex (typically 5,000 per 24 hours). However, emails 5sent via Workflow Rules, Process Builder, or Flow6 Builder (Email Alerts) have a much higher daily limit (2,000,000 per org).
To meet the requirement of 10,000 emails per day, an Apex-based solution using SingleEmailMessage() (Option D) would likely hit the daily limit and cause transaction failures. MassEmailMessage() (Option C) is generally intended for manual mass mailing to Contacts or Leads and is not optimized for automated, per- record trigger logic. While Batch Apex (Option A) could process many records, the underlying SingleEmailMessage limit would still apply.
By using an Email Alert triggered by a Record-Triggered Flow, the developer leverages the platform's high- volume email engine. This approach is declarative, requires no custom code, is easier for administrators to maintain, and comfortably handles the 10,000 daily email requirement without risking governor limit exceptions. It also ensures the "criteria evaluation" happens within the standard Flow entry conditions.
NEW QUESTION # 95
The "Webservice" keyword...
- A. Can be used on all classes
- B. Used for any member variables included
- C. All of the above
- D. Method must be static, and class must be global
Answer: C
NEW QUESTION # 96
An org has an existing process, built using Process Builder, on Opportunity that sets a custom field, commissionBaseAmount_ c, when an Opportunity is edited and the Opportunity's Amount changes.
A developer recently deployed an Opportunity before update trigger that use the commissionBaseAmount_ c, andcomplex logic to calculate a value for a custom field, CommissionAmount_ c, when an Opporunity stage changes to Closed/Won.
Users report that when they change the Opportunity stage changes to Closed/Won and also change the Amount during the same save, the commission_ c is incorrect.
Which action should the developer take to correct this problem?
- A. Call the trigger from the process.
- B. Call the process from the trigger.
- C. Replace the process with a fast field Update record-trigger flow.
Answer: C
NEW QUESTION # 97
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 user is creating the record as Closed
- B. A user is editing the record multiple times
- C. A workflow rule is firing with a Create Task action
- D. A workflow rule is firing with a Field Update action
Answer: B
NEW QUESTION # 98
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?
- A. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method.
- B. Move the prerequisite reference data setup to a @testSetup method in the test class.
- C. Move the prerequisite reference data setup to the constructor for the test class.
- D. Turn off triggers, flows, and validations when running tests.
Answer: B
Explanation:
@testSetup method improves test performance. It allows data sharing across test methods within a class, reducing redundant data creation.
References: Using the testSetup Method
NEW QUESTION # 99
Given the following information regarding Universal Containers (UC):
* UC represents their customers as Accounts in Salesforce.
* All customers have a unique Customer__Number_c that is unique across all of UC's systems.
* UC also has a custom Invoice c object, with a Lookup to Account, to represent invoices that are sent out from their external system.
UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time.
What is the optimal way to implement this?
- A. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
- B. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.
- C. Ensure Customer Number cis an External ID and that a custom field Invoice Number cis an External ID and Upsert invoice data nightly.
- D. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly,
Answer: D
NEW QUESTION # 100
A developer needs test data for Apex test classes.
What can the developer use to provide test data to the test methods? (Choose two.)
- A. myDataFactory.createTestRecords (10)
- B. List<sObject> Is = Test.loadData (Lead.sObjectType, 'myTestLeads');
- C. List<sObject> Is = Test.loadDat (Lead.sObjectType, $Resource + 'myTestLeads');
- D. Database.createTestRecords (10)
Answer: A,B
NEW QUESTION # 101
An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature.
The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.
What is the optimal way to implement these requirements?
- A. Write a Validation Rule on the Contact for the Is Primary logic and a before update trigger on Contact for the last name logic.
- B. Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.
- C. Write an after update trigger on Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.
- D. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.
Answer: D
NEW QUESTION # 102
A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:
How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?
- A. Use the gerSubjectType method in an Apex class.
- B. Add force:hasSobjectName to the implements attribute.
- C. Create a design attribute and configure via App Builder.
- D. Set the sObject type as a component attribute.
Answer: B
NEW QUESTION # 103
A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?
- A. Publicly expose an Apex Web Service via Force.com Sites.
- B. Host a Web-to-Lead form on the company website.
- C. Publicly expose a Visualforce page via Force.com Sites.
- D. Create a web service on Heroku that uses Heroku Connect.
Answer: A
NEW QUESTION # 104
A company represents their customers as Accounts in Salesforce. All customers have a unique Customer_Number__c that is unique across all of the company's systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time. What is the optimal way to implement this?
- A. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly.
- B. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.
- C. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
- D. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice
Answer: C
NEW QUESTION # 105
A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org.
Users report that they receive a ''Maximum view state size limit'' error message under certain conditions.
According to Visualforce best practice, which three actions should the developer take to reduce the view state? Choose 3 answers
- A. Refine any SQQL queries to return only data relevant Co the page.
- B. Use the final keyword In the controller for variables that will not change.
- C. Use the private keyword in the controller for variables
- D. Use filters and pagination to reduce the amount of data.
- E. Use the transient keyword in the Apex controller for variables that do not maintain state.
Answer: A,D,E
NEW QUESTION # 106
A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity's Probability is greater than 50%.
What is the optimal way to automate this?
- A. Build a Process on Opportunity.
- B. Build a Flow on Opportunity.
- C. Create a Workflow on Opportunity.
- D. Use an Apex Trigger on Opportunity.
Answer: D
NEW QUESTION # 107
When testing batch classes, what must a developer do? (Choose two.)
- A. Limit the amount of records you test to < 200
- B. Call the class' "execute" method
- C. Encapsulate code in Test.startTest() and Test.stopTest()
- D. Use seeAllData=true
Answer: A,C
Explanation:
Explanation/Reference:
Explanation:
If you use "seeAllData=true," you are a bad person
NEW QUESTION # 108
Universal Containers stores user preferences in a Hierarchy Custom Setting, User_prefs_c, with a Checkbox field, show_Help_c, Company-Level defaults are stored at the organizational level, but may be overridden at the user level, If a user has not overridden preferences, then the defaults should be used.
How should the Show_Help_c preference be retrieved for the current user?
- A. Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c;
- B. Boolean show = User_Prefs_c, getValues ( ). Show _Help_c;
- C. Boolean show = User_Prefs_c, getinstance( ), Show_Help _c;
- D. Boolean show = User prefs_c, Show_Help_c;
Answer: C
NEW QUESTION # 109
Universal Containers has an existing automation where a custom record called Account Plan is created upon an Account being marked as a Customer. Recently, a Workflow Rule was added so that whenever an Account is marked as a Customer, a 'Customer Since' date field is updated with today's date.
Now, since the addition of the Workflow Rule, two Account Plan records are created whenever the Account is marked as a Customer.
What might cause this to happen?
- A. The Apex Trigger responsible for the record creation does not use a static variable to ensure It only fires once.
- B. The Process Builder responsible for the record creation fires before and after the Workflow rule.
- C. The Workflow Rule responsible for the record creation fires twice because the 'Customer Since' field Update Is marked as 'Re-evaluate Workflow Rules After Field Change
- D. The Apex Trigger responsible for the record creation is not bulk sate and calls insert inside of a for loop.
Answer: C
NEW QUESTION # 110
A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build an application that can create, retrieve, and update common object records in all of the different orgs.
Which method of integration should the application use?
- A. SOAP API with the Enterprise WSDL
- B. Apex REST Web Service
- C. Metadata API
- D. SOAP API with the partner WSDL
Answer: D
NEW QUESTION # 111
What can the Apex Continuation class be used for?
- A. Maintaining an Apex transaction across multiple DML statements.
- B. Chaining multiple Queueable Apex jobs to be processed one after another.
- C. Making asynchronous callouts to SOAP or REST Web Services from Visualforce.
- D. Progressing records to the next stage of an approval process in Apex.
Answer: C
NEW QUESTION # 112
Code must have X% overall code coverage.
- A. X = 50
- B. X = 75
- C. X = 100
- D. X = 65
Answer: B
Explanation:
All triggers must have at least 1% code coverage
NEW QUESTION # 113
A developer has a Visual force page that automatically assign ownership of an Account to a queue save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?
- A. The test class does not implement the Queueabfe interface.
- B. The test class does not use the Bulk API for loading test data.
- C. The test class does not retrieve the updated value- from the database.
- D. The test class does not use the seeAllData=true annotation,
Answer: C
NEW QUESTION # 114
A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input, when the search Is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed?
- A.

- B.

- C.

- D.

Answer: D
NEW QUESTION # 115
......
PDII Exam with Accurate Platform Developer II PDF Questions: https://www.briandumpsprep.com/PDII-prep-exam-braindumps.html
True Salesforce Exam Extraordinary Practice For the PDII Exam: https://drive.google.com/open?id=1EGeq3Z0PJOEj6S1zgbqM5hHsMHRqiJyY
