Salesforce pdii practice test

Platform Developer II Exam

Last exam update: Dec 18 ,2024
Page 1 out of 26. Viewing questions 1-15 out of 396

Question 1

Which two best practices should the developer Implement to optimize this code?
Choose 2 answers

  • A. Use a collection for the DML statement.
  • B. Query the Pricing_structure__c records outside of the loop.
  • C. Change the trigger context to after update, after insert.
  • D. Remove the DML statement.
Answer:

B, D


User Votes:
A 2 votes
50%
B 2 votes
50%
C
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
1 year ago

It is missing the code snippet.


Question 2

A developer wrote an Apex method that makes an HTTP callout to an external system to get
specialized data when a button is clicked from a custom Lightning web component on the Account
record page.
Recently, users have complained that it takes longer than desired for the data to appear on the page
after clicking the button.
What should the developer use to troubleshoot this issue?

  • A. Lightning Inspector
  • B. Devdoper Console
  • C. Salesforce CU
  • D. Event Logs
Answer:

C


User Votes:
A 1 votes
50%
B
50%
C 2 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
bojana_b
1 year, 5 months ago

Right answer is A Lightning Inspector


Question 3

A business currently has a process to manually upload orders from its external Order Management
System (OMS) into Salesforce.
This is a labor intensive process since accounts must be exported out of Salesforce to get the IDs. The
upload file must be updated with the correct account IDs to relate the orders to the corresponding
accounts.
Which two recommendations should make this process more efficient?
Choose 2 answers

  • A. Ensure the data in the file is sorted by the order ID.
  • B. Use the upsert wizard in the Data Loader to import the data.
  • C. Identify unique fields on Order and Account and set them as External IDs.
  • D. Use the Insert wizard In the Data Loader to Import the data.
Answer:

B, C


User Votes:
A
50%
B 3 votes
50%
C 3 votes
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

Consider the following code snippet:

Choose 2 answers

  • A. import getOrders from ,@salesforce/apex/OrderController.getAvailableOrders';
  • B. import ( LightningElement—apt ) from 'lwc*.-
  • C. import getOrders from @salesforc/apex/c.OrderController.getAvailablOrd#r»';
  • D. import { LightningElement, wire ) from 'lwc';
Answer:

A, D


User Votes:
A 3 votes
50%
B
50%
C
50%
D 3 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

Users upload .csv files in an external system to create account and contact records in Salesforce. Up
to 200 records can be created at a time. The users need to wait for a response from Salesforce in the
external system, but the data does not need to synchronize between the two systems.
Based on these requirements, which method should a developer use to create the records in
Salesforce?

  • A. REST API request using composite/vbatch/
  • B. REST API request using composite/tree/
  • C. Apex web services
  • D. Bulk API 2.0
Answer:

D


User Votes:
A
50%
B
50%
C
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Which annotation should a developer use on an Apex method to make it available to be wired to a
property In a Lightning web component?

  • A. @RemoteAction
  • B. @AuraEnabledcacheable=true)
  • C. @QRemoteAction(caccheable=true)
  • D. @AuraEnabled
Answer:

B


User Votes:
A
50%
B 3 votes
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
isirbu
1 year, 2 months ago

D ... B is a specific request


Question 7

A developer is tasked with creating a Lightning web component that allows users to create a Case for
a selected product, directly from a custom Lightning page. The input fields in the component are
displayed in a non-linear fashion on top of an image of the product to help the user better
understand the meaning of the fields.
Which two components should a developer use to implement the creation of the Case from the
Lightning web component?
Choose 2 answers

  • A. lightning-record-edit-form
  • B. lightning-input
  • C. lightning-record-form
  • D. lightning-input-field
Answer:

A, C


User Votes:
A 2 votes
50%
B 1 votes
50%
C 3 votes
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
isirbu
1 year, 2 months ago

A and D ... why should you use c when is a less powerfull version of A


Question 8

A developer is building a Lightning web component that searches for Contacts and must
communicate the search results to other Lightning web components when the search completes.
What should the developer do to implement the communication?

  • A. Publish an event on an event channel.
  • B. Fire an application event.
  • C. Publish a message on a message channel.
  • D. Fire a custom component event.
Answer:

C


User Votes:
A
50%
B 1 votes
50%
C 3 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

Consider the following code snippet:
A developer created the following test class to provide the proper code coverage for the snippet
above:
However, when the test runs, no data is returned and the assertion fails.
However, when the test runs, no data is returned and the assertion fails.
Which edit should the developer make to ensure the test class runs successfully?

  • A. Enclose the method call within Test. startTest () and Test , stop Test ()
  • B. Implement the seeAllData=true attribute in the @isTest annotation.
  • C. Implement the without sharing keyword in the searchfeature Apex class.
  • D. Implement the setFixedSearchResults method in the test class.
Answer:

D


User Votes:
A 1 votes
50%
B 1 votes
50%
C
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

Universal Containers (UC) has custom Order and Order Line objects that represent orders placed by
its customers.
A developer has a new requirement that UC's external enterprise resource planning (ERP) system
must be able to integrate with Salesforce to create orders for existing customers in Salesforce
whenever an order is placed in the ERP system.
What should the developer use to create the orders in Salesforce7

  • A. Connect API
  • B. Change Data Capture API
  • C. SObject Tree API D, Event Monitoring API
Answer:

A


User Votes:
A 2 votes
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 11

A developer recently released functionality to production that performs complex commission
calculations in Apex code called from an Opportunity trigger. Users report that the calculations seem
incorrect because the values they see for commissions are wrong.
The developer has representative test data in their developer sandbox.
Which three tools or techniques should the developer use to execute the code and pause it at key
lines to visually inspect values of various Apex variables?
Choose 3 answers

  • A. Developer Console B, visual Studio Code
  • C. Breakpoints
  • D. Apex Replay Debugger
  • E. Workbench
Answer:

A, B, D


User Votes:
A 2 votes
50%
C 2 votes
50%
D 2 votes
50%
E
50%
Discussions
vote your answer:
A
C
D
E
0 / 1000
12 months ago

BCD B, visual Studio Code
C. Breakpoints
D. Apex Replay Debugger


Question 12

Consider the following code snippet:
Users of this Visualforce page complain that the page does a full refresh every time the Search
button is pressed.
What should the developer do to ensure that a partial refresh is made so that only the section
identified with opportunity List is re-drawn on the screen?

  • A. Ensure the lotion method search returns null.
  • B. Implement the rerendered attribute on the <apex:commandButton>tag.
  • C. Enclose the DATA table within the <apex:actionRegion> tag.
  • D. Implement the <apex:actionFunction> tag with immediate = true.
Answer:

C


User Votes:
A
50%
B
50%
C 2 votes
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
12 months ago

Ans is B
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionRegion.htm
Note that an <apex:actionRegion> component only defines which components the server processes during a request—it doesn’t define what areas of the page are re-rendered when the request completes


Question 13

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. Use a custom metadata type to store key/value pairs.
  • B. Query the FirstDayOfweek field from the Locale for the current user.
  • C. Use Userinfor. getLocale () in the component.
  • D. Import the firstDayofWeek property in the component.
Answer:

C


User Votes:
A
50%
B
50%
C 2 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
1 year ago

import firstDayOfWeek from '@salesforce/i18n/firstDayOfWeek';


Question 14

A developer used custom settings to store some configuration data that changes occasionally.
However, tests are now failing in some of the sandboxes that were recently refreshed.
What should be done to eliminate this issue going forward?

  • A. Set the setting type on the custom setting to List.
  • B. Replace custom settings with custom metadata.
  • C. Set the setting type on the custom setting to Hierarchy.
  • D. Replace custom settings with static resources.
Answer:

B


User Votes:
A
50%
B 2 votes
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

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. Apex method that returns a Continuation object
  • B. Screen now
  • C. Process Builder
  • D. Lightning web component
Answer:

A, D


User Votes:
A 2 votes
50%
B
50%
C
50%
D 2 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
isirbu
1 year, 2 months ago

A B b because it is standard

12 months ago

B Option is misspelled, it should be screen flow

12 months ago

but the answers should be A and D. screen flow doesn't support Continuation object.

To page 2