Vendor: Salesforce
Exam Code: PDII
Exam Name: Platform Developer II
Version: DEMO
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
QUESTION 1
An environment has two Apex Triggers: an after-update trigger on Account and an after-update
trigger on Contact. The Account after-update trigger fires whenever an Account's address is
updated, and it updates every associated Contact with that address. The Contact after-update
trigger fires on every edit, and it updates every Campaign Member record related to the Contact
with the Contact's state.
Consider the following: A mass update of 200 Account records' addresses, where each Account
has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact
records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?
A. The mass update will fail, since the two triggers fire in the same context, thus exceeding the
number of records processed by DML statements.
B. There will be no error, since each trigger fires within its own context and each trigger does not
exceed the limit of the number of records processed by DML| statements.
C. There will be no error, since the limit on the number of records processed by DML statements is
50,000.
D. The mass update of Account address will succeed, but the Contact address updates will fail due
to exceeding number of records processed by DML statements.
Answer: A
Explanation:
The mass update will fail since the triggers fire in the same transaction. This will implies 20200
records updated by the DML statement where the limit is 10000.
QUESTION 2
What is a benefit of JavaScript remoting over Visualforce Remote Objects?
A. Supports complex server-side application logic
B. Does not require any JavaScript code
C. Does not require any Apex code
D. Allows for specified re-render targets
Answer: A
Explanation:
Either remote object or @remoteAction requires a JS callback,promise, async&await function to
parse the JSON result from back-End to client side. For example, you can easily construct a
wrapper class using @remoteAction in Apex where information from multiple queries or proxy
variables can be brought together. For remote object you will need JS to do "promise.all" in order
to cover that kind of wrapper in Apex, which will be very complex and hard to read.
QUESTION 3
A Developer wishes to improve runtime performance of Apex calls by caching results on the
client.
What is the best way to implement this?
A. Decorate the server-side method with @AuraEnabled(cacheable=true).
B. Set a cookie in the browser for use upon return to the page.
C. Decorate the server-side method with @AuraEnabled(storable=true).
D. Call the setStorable() method on the action in the JavaScript client-side code.
Answer: A
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 2
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
Explanation:
To improve runtime performance, set @AuraEnabled(cacheable=true) to cache the method
results on the client.
QUESTION 4
A Visualforce page contains an industry select list and displays a table of Accounts that have a
matching value in their Industry field.
When a user changes the value in the industry select list, the table of Accounts should be
automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?
A. Add an <apex: actionFunction> within the <apex : selectOptions>.
B. Add an <apex: actionFunction> within the <apex: select List >.
C. Add an <apex: actionSupport> within the <apex:selectList>.
D. Add an <apex: actionSupport> within the <apex: selectOptions>.
Answer: C
Explanation:
A component that adds AJAX support to another component, allowing the component to be
refreshed asynchronously by the server when a particular event occurs, such as a button click or
mouseover.
QUESTION 5
Which interface needs to be implemented by a Lightning Component so that it may be displayed
in modal dialog by clicking a button on a Lightning Record page?
A. Force: lightningQuickAction
B. Lightning:editAction
C. Fightning:quickAction
D. Force:lightningEditAction
Answer: A
Explanation:
Add the force:lightningQuickAction interface to a Lightning component to allow it to be used as a
custom action in Lightning Experience or the Salesforce.
QUESTION 6
Sometimes events on Salesforce need to be handled by an external system due to the scale or
type of process being executed. Consider the use case of a user in Salesforce needing to get
pricing for an order they are building in Salesforce while on the phone with a customer. The
pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it
will be leveraged by making a request of the third-party system. The response, in this case the
pricing, will be returned and stored back in Salesforce. What is the optimal solution?
A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 3
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
Salesforce
B. An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing
back in Salesforce
C. A Process Builder process and Outbound Message to fetch the pricing upon save and store the
pricing in Salesforce
D. An ETL tool to process batches of newly saved Orders every few minutes to store the pricing
back in Salesforce
Answer: A
Explanation:
Requirement is real time update as customer is waiting on phone, triggers can't make
synchronous calls, ETL is batch (not real-time).
QUESTION 7
Which three Visualforce components can be used to initiate Ajax behavior to perform partial page
updates? Choose 3 answers
A. <apex:actionSupport>
B. <apex:commandLink>
C. <apex:actionStatus>
D. <apex:commandButton>
E. <apex:form>
Answer: ABD
Explanation:
The simplest way to implement a partial page update is to use the reRender attribute on an
<apex:commandLink> or <apex:commandButton> tag to identify a component that should be
refreshed. When a user clicks the button or link, only the identified component and all of its child
components are refreshed.
QUESTION 8
A developer has written an After Update trigger on Account. A workflow rule and field update
cause the trigger to repeatedly update the Account records.
How should the developer handle the recursive trigger?
A. Deactivate the trigger and move the logic into a Process or Flow
B. Deactivate the workflow rule to prevent the field update from executing
C. Use a static variable to prevent the trigger from executing more than once
D. Use a global variable to prevent the trigger from executing more than once
Answer: C
Explanation:
A static variable is static only within the scope of the Apex transaction. It’s not static across the
server or the entire organization. The value of a static variable persists within the context of a
single transaction and is reset across transaction boundaries. For example, if an Apex DML
request causes a trigger to fire multiple times, the static variables persist across these trigger
invocations.
To store information that is shared across instances of a class, use a static variable. All instances
of the same class share a single copy of the static variable. For example, all triggers that a single
transaction spawns can communicate with each other by viewing and updating static variables in
a related class. A recursive trigger can use the value of a class variable to determine when to exit
the recursion.
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 4
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
QUESTION 9
A custom field Exec_Count_c of type Number is created on an Account object. An account record
with value of "1" for a: Exec__Count_c is saved. A workflow field update is defined on the
Exec_Count_c field, to increment its value every time an account record is created or updated.
The following trigger is defined on the account:
trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update){ for
(Account accountlnstance: Trigger.New){ if (Trigger . isBefore){ accountlnstance Exec_Count_c
+= 1; } System, debug (accountlnstance.Exec_Count_c); } }
A. 1,2,3,3
B. 1,2,3,4
C. 2, 2, 4, 4
D. 2,2,3,3
Answer: C
Explanation:
before trigger: 1->2, output 2;
after trigger: output 2;
workflow rule: 2->3;
before update: 3->4, output 4;
after update: output 4.
QUESTION 10
What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records
B. Test methods must call the batch execute() method once
C. Test methods must use the @isTest (SeeAIIData=true) annotation
D. Test methods must run the batch between TeststartTestQ and Test.stopTestQ
Answer: AD
Explanation:
Make sure that the number of records inserted is less than or equal to the batch size of 200
because test methods can execute only one batch. You must also ensure that the Iterable
returned by the start method matches the batch size.
QUESTION 11
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
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 5
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
B. A workflow rule is firing with a Create Task action
C. A workflow rule is firing with a Field Update action
D. A user is editing the record multiple times
Answer: C
Explanation:
As the workflow field update, makes the trigger to run again, and in the same transaction
instance, so trigger creates second record.
QUESTION 12
A developer has built a multi-page wizard using a single Custom Controller to query and update
data. Users are complaining that the pages are loading slowly.
What will improve performance? (Choose three.)
A. Reducing the view state
B. Using actionRegion and rerender
C. Turning off the standard stylesheet
D. Setting the Apex Page attribute cache=true
E. Using selective queries
Answer: ABE
Explanation:
By default, pages that do not have the cache attribute set are cached for ten minutes (600
seconds). So it already defatuls to cache=true and it will not have effect in page loading.
Only the components in the body of the are processed by the server, thereby increasing the
performance of the page.
QUESTION 13
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 Flow on Opportunity.
B. Create a Workflow on Opportunity.
C. Use an Apex Trigger on Opportunity.
D. Build a Process on Opportunity
Answer: A
Explanation:
Since the process builder is going to depreciate, even salesforce recommends flow over it and
specifically mentions flow can do all things that a process builder can do even more than it.
QUESTION 14
Which API can b|e used to execute unit tests? (Choose three.)
A. Streaming AP
B. Test API
C. Tooling API
D. SOAP API
E. Metadata API
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 6
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
Answer: CDE
Explanation:
https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm
1. You can use the runTests() call from the SOAP API to run tests synchronously.
2. You can also run tests using the Tooling REST API. Use the /runTestsAsynchronous/ and
/runTestsSynchronous/ endpoints to run tests asynchronously or synchronously.
So the answer to the question should be Tooling API, SOAP API and Metadata API, because
Streaming API is about events and notifications, and there is no such thing as Test API.
QUESTION 15
Which two objects can be inserted in the same transaction? (Choose two.)
A. Opportunity and User
B. Account and AccountShare
C. Case and CaseComment
D. Account and Group
Answer: BC
Explanation:
Setup objects are those which interacts with metadata like User, Profile, Layout etc. All other
object (Standard and Custom) are non setup object.
One important note is that we cannot perform DMLs on setup and non setup objects in same
transaction.
QUESTION 16
Which is a valid Apex REST Annotation? (Choose two.)
A. @Http Patch
B. @HttpDelete
C. @HttpUpsert
D. @HttpAction
Answer: AB
Explanation:
Use PUT when you want to modify a singular resource which is already a part of resources
collection. PUT replaces the resource in its entirety. Use PATCH if request updates part of the
resource. Use POST when you want to add a child resource under resources collection.
QUESTION 17
Which are relevant practices while analyzing the timeline of different types of transactions in the
execution overview panel? (Choose two.)
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree should be use to analyze events further starting from the one that take the
least amount of time
C. The execution tree can be used with the execution log to filter and get specific information about
events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant
amount of time
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 7
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
Answer: AD
Explanation:
Execution Tree and Peformance Tree are in another panel named "Stack Tree".
QUESTION 18
A developer needs to send Account records to an external system for backup purposes. The
process must take a snapshot of Accounts as they are saved and then make a callout to a
RESTful web service. The web service can only receive, at most, one record per call. Which
feature should be used to implement these requirements?
A. workflow
B. @future
C. Queueable
D. Process Builder
Answer: D
Explanation:
Call the invocable method from process builder and from invocable method call the @future
method and write your callout logic there in @future method.
QUESTION 19
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 all Workflow Rules have fired. What is the
optimal way to accomplish this?
A. Use a Workflow Email Alert.
B. Usea MassEmailMessage() with an Apex Trigger.
C. Use a SingleEmailMessage() with an Apex Trigger.
D. Use an Email Alert with Process Builder.
Answer: A
Explanation:
The daily limit for emails sent from workflow and approval-related email alerts is 1,000 per
standard Salesforce license per organization. The overall organization limit is 2,000,000.
QUESTION 20
UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to
create a Loan__c record whenever an Opportunity is won. What is the optimal solution for UC
Loans to accomplish this?
A. Quick Action
B. Apex Trigger
C. Process Builder
D. Workflow Rule
Answer: C
Explanation:
Since PB is more progressive tool than workflow.
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 8
https://www.lead2pass.com
★ Instant Download ★ PDF And VCE ★ 100% Passing Guarantee ★ 100% Money Back Guarantee
Thank You for Trying Our Product
Lead2pass Certification Exam Features:
★ More than 99,900 Satisfied Customers Worldwide.
★ Average 99.9% Success Rate.
★ Free Update to match latest and real exam scenarios.
★ Instant Download Access! No Setup required.
★ Questions & Answers are downloadable in PDF format and
VCE test engine format.
★ Multi-Platform capabilities - Windows, Laptop, Mac, Android, iPhone, iPod, iPad.
★ 100% Guaranteed Success or 100% Money Back Guarantee.
★ Fast, helpful support 24x7.
View list of all certification exams: http://www.lead2pass.com/all-products.html
10% Discount Coupon Code: ASTR14
Get Latest & Actual PDII Exam's Question and Answers from Lead2pass. 9
https://www.lead2pass.com