Winter Special Sale Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 713PS592

PDII Salesforce Certified Platform Developer II (SU24) Questions and Answers

Questions 4

What is the best practice to initialize a Vizualforce page in a test class?

Options:

A.

Use Test. setCurrentPage (Page. MyTeatPage);

B.

Use Test. currantPage .getParamatars put (MyTaestPaga) ;

C.

Use controller. currentPage. setPage (MyTastfage) ;

D.

Use Test. setCurrentPage MyTestPags;

Buy Now
Questions 5

A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called survey Response c do not belong to a list of blocked domains.

The list of blocked domains is stored in a custom object for ease of maintenance by users. The survey Response c object is populated via a custom Visualforce page.

What is the optimal way to implement this?

Options:

A.

Implement the logic in validation rules on the Contact and the Burvey Response_c Objects.

B.

Implement the logic in a helper class that is called by an Apex trigger on Contact and from the custom Visualforce page controller.

C.

Implement the logic in an Apex trigger on Contact and also implement the logic within the custom Visualforce page controller.

D.

Implement the logic in the custom Visualforce page controller and call "that method from an Apex trigger on Contact.

Buy Now
Questions 6

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the

user.

The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded”.

What step should the developer take to resolve this issue?

Options:

A.

Adjust any code that filters by picklist values since they are not indexed,

B.

Remove instances of the transient keyword from the Apex controller to avoid the view state error.

C.

Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.

D.

Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex controller.

Buy Now
Questions 7

A developer is asked to find a way to store sacret data with an ability to specify which profiles and users can access which secrets.

What should be used to store this data?

Options:

A.

system.Cookie class

B.

Custom settings

C.

Static resources

D.

Custom metadata

Buy Now
Questions 8

A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products.

A developer received these requirements:

* Whenever a product is created or updated in the PIM, a product must be

created or updated as a Product? record in Salesforce and a PricebookEntry

record must be created or updated automatically by Salesforce.

= The PricebookEntry should be created in a Priceboek2 that is specified in a

custom setting.

What should the developer use to satisfy these requirements?

Options:

A.

Event Monitoring

B.

Invocable Action

C.

SObject Tree REST

D.

Custom Apex REST

Buy Now
Questions 9

A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially.

How should the developer write this Apex code without running into governor limits and system limitations?

Options:

A.

Use Queueable Apex to chain the jobs to run sequentially.

B.

Use Apex Scheduler to schedule each process.

C.

Use multiple 3zutuze methods for each process and callout.

D.

Use Limits class to stop entire process once governor limits are reached.

Buy Now
Questions 10

Universal Containers stores user preferences in a hierarchy custom setting,

user Prefs_c, with a checkbox field, show _help co. 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?

Options:

A.

Boolean show = User_Prefa_ c.getValuea().Show_Help_ co;

B.

Boolean show =

User Prefs c.getValues(UserInfo.getUserid{)).Show_Help c;

C.

Boolean show = User_Prefs_c.getlnstance(].Show Help c;

D.

Boolean show = User Prefs_c.show Melp_c;

Buy Now
Questions 11

A developer has a test class that creates test data before making a mock callout but now receives a 'You have uncommitted work pending. Please commit or rollback before calling out’ error.

Which step should be taken to resolve the error?

Options:

A.

Ensure both the Insertion and mock callout occur after the I==L. stoptest_().

B.

Ensure the records are Inserted before the Tezt.startTest() statement and the mock callout occurs within a method annotated with @testSetup.

C.

Ensure both the insertion and mock callout occur after the Test.startTest().

D.

Ensure the records are inserted before the Test.startTess() statement and the mock callout occurs after the Test. Startest().

Buy Now
Questions 12

A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.

Which functionality consideration impacts the final decision?

Options:

A.

Does the screen need to be accessible from the Lightning Experience UI?

B.

Does the screen need to be rendered as a PDF without using a thirdparty application?

C.

Will the screen make use of a JavaScript framework?

D.

Will the screen be accessed via a mobile app?

Buy Now
Questions 13

Consider the following code snippet:

PDII Question 13

A developer created the following test class to provide the proper code coverage for the snippet above:

PDII Question 13

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?

Options:

A.

Implement the without sharing keyword in the searchFeaturs Apex class.

B.

Implement the seeAllData=true attribute in the @1sTest annotation.

C.

Enclose the method call within Test. startbest i) and @Test_stopTast |).

D.

Implement the setFixedSearchResult= method in the test class.

Buy Now
Questions 14

Instead of waiting to send emails to support personnel directly from the finish

method of a batch Apex process, Universal Containers wants to notify an external

system in the event that an unhandled exception occurs.

What is the appropriate publish/subscribe logic to meet this requirement?

Options:

A.

Publish the error event using the Eventbus. publish () method.

B.

No publishing is necessary. Have the external system subscribe to the BatchapexErrorEvent.

C.

Publish the error event using the addError method.

D.

Publish the error event with a Flow.

Buy Now
Questions 15

Universal Containers ne=ds to integrate with several external systems. The process Is Initiated when a record Is created in Salesforce, The remote systems do not require Salesforce to wait for a response before continuing.

What is the recommended best solution to accomplish this?

Options:

A.

PushTopic event

B.

Qutbound message

C.

Trigger with HTTP callout

D.

Platform event

Buy Now
Questions 16

The Salesforce admin et 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.

PDII Question 16

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

Which code segment is the most efficient way to fulfill this request?

A)

PDII Question 16

B)

PDII Question 16

C)

PDII Question 16

D)

PDII Question 16

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 17

Refer to the exhibit

PDII Question 17

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?

Options:

A.

Enclose the DATA table within the tag.

B.

Implement the render attribute on the tag.

C.

Ensure the action method search returns null.

D.

Implement the tag with immediate = true.

Buy Now
Questions 18

A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build a single Java application that can create, retrieve, and update common object records in all of the different orgs.

Which method of integration should the application use?

Options:

A.

SOAP API with the Partner WSDL

B.

Apex REST Web Service

C.

SOAP API with the Enterprise WSDL

D.

Metadata APT

Buy Now
Questions 19

A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.

What should the developer do to determine which objects to include in the response?

Options:

A.

Check the isCustom() value on the sObject describe result,

B.

Import the list of all custom objects from @salesforce/schema.

C.

Check the getobiectType [) value for ‘Custom’ or "Standard’ on the sObject describe result.

D.

Use the getcustomobjects() method from the Schema class.

Buy Now
Questions 20

A developer is asked to develop a new AppFxchange application. A feature of the program creates Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to

most customers.

What should the developer use to store and package the custom configuration settings for the app?

Options:

A.

Custom objects

B.

Custom settings

C.

Custom metadata

D.

Custom labels

Buy Now
Questions 21

Refer to the Aura component below:

PDII Question 21

A developer receives complaints that the component loads slowly.

Which change can the developer implement to make the component perform faster?

Options:

A.

Change the type of contactInfo to "Map”.

B.

Move the contents of

C.

Add a change event handler for showContactInfo.

D.

Change the default for showContactInfo to “False.

Buy Now
Questions 22

An Apex trigger and Apex class increment a counter, Edit __C, any time the Case is changed.

PDII Question 22

A)

PDII Question 22

B)

PDII Question 22

C)

PDII Question 22

D)

PDII Question 22

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 23

A company has code to update a Request and Request Lines and make a callout to

their external ERP system's REST endpoint with the updated records.

PDII Question 23

The callousUtil.makeRestCallout fails with a "You have uncommitted work pending. Please commit or rollback before calling cut’ error.

What should be done to address the problem?

Options:

A.

Change the callousUtil makeRestCallout to an @InvocsblsMethod method.

B.

Remove the Database. setSavepoint and Database. rollback.

C.

Change the CallousUtill .makeRestCallout to an @future method.

Buy Now
Questions 24

There are user complaints about slow render times of a custom data table within a Visualforce page that loads thousands of Account records at once.

What can a developer do to help alleviate such issues?

Options:

A.

Use JavaScript remoting to query the accounts.

B.

Use the transient keyword in the Apex code when querying the Account records.

C.

Upload a third-party data table library as a static resource.

D.

Use the standard Account List controller and implement pagination.

Buy Now
Questions 25

A company uses Dpportunities to track sales to their customers and their org has millions of Opportunities. They want to begin to track revenue over time through a related Revenue object.

As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic.

They estimate that roughly 100,000 Opportunities will have Revenue records created and populated.

What is the optimal way to automate this?

Options:

A.

Use system, acheduladeb() to schedule a patakape.Scheduleable class.

B.

Use system, enqueuJob (| to invoke a gueusable class.

C.

Use Database. executeBatch () to invoke a Queueable class.

D.

Use Database. =executeBatch() to invoke a Database. Batchable class.

Buy Now
Questions 26

Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.

What is the appropriate publish/subscribe logic to meet this requirement?

Options:

A.

Have the external system subscribe to a custom Platform Event that gets fired with addError{).

B.

Have the external system subscribe to a custom

Platform Event that gets fired with EventBus.publish(1,

C.

Have the external system subscribe to a standard

Platform Event that gets fired with with Eventbus.publish(1.

D.

Have the external system subscribe to a standard Platform Event that gets fired.

Buy Now
Questions 27

What is the correct way to fix this?

Options:

A.

Add Test.startTest() before and add Test. stopTest() after both Line 7 and Line 20 of the code.

B.

Add Test_startTest() before and add Test. stopTest() after Line 18 of the code.

C.

Use Limits.getlimitQueries() to find the total number of queries that can be issued.

D.

Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced.

Buy Now
Questions 28

Refer to the test method below''

PDII Question 28

The test method calls a web service that updates an external system with Account

information and sets the Accounts integration_Updated__c checkbox to True when it completes.

The test fails to execute and exits with an error: "Methods defined as TestMethod do

not support Web service callouts.”

A)

PDII Question 28

B)

PDII Question 28

C)

PDII Question 28

D)

PDII Question 28

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 29

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.

PDII Question 29

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

A)

PDII Question 29

B)

PDII Question 29

C)

PDII Question 29

D)

PDII Question 29

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 30

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

A)

PDII Question 30

B)

PDII Question 30

C)

PDII Question 30

D)

PDII Question 30

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 31

Refer to the following code snippets:

A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user.

PDII Question 31

When the component is rendered, the following message is displayed: "Error retrieving data”.

Which modification should be implemented to the Apex class to overcome the issue?

Options:

A.

Use the Cacheable=true attribute in the Apex method,

B.

Ensure the OWD for the Opportunity object is Public.

C.

Edit the code to use the w. cut sharing keyword in the Apex class.

D.

Use the Continuation=true attribute in the Apex method.

Buy Now
Questions 32

Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records?

Choose 2 answers

Options:

A.

SELECT Id FROM Account WHERE Name LIKE '!-NULL

B.

SELECT Id FRCM Account WHERE Name != ’ ’

C.

SELECT Id FRCM Account WHEP Name IN (List of Names) AND Customer_Number_c= 'ValueA

D.

SELECT Id FROM Account WHERE II IK (List of Account Ida)

Buy Now
Questions 33

Refer to the component code and requirements below:

PDII Question 33

A)

PDII Question 33

B)

PDII Question 33

C)

PDII Question 33

D)

PDII Question 33

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 34

Refer to the markup below:

PDII Question 34

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?

Options:

A.

Replace Layout-type =''Full1" with Layout-type="Partial”.

B.

Replace layout-type =''1" with fields=(fields}.

C.

Add density="compat" to the component.

D.

Add cache="true" to the component.

Buy Now
Questions 35

A company wants to run different logic based on an Opportunity's record type.

Which code segment handles this request and follows best practices?

A)

PDII Question 35

B)

PDII Question 35

C)

PDII Question 35

D)

PDII Question 35

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 36

The Account object has a field, Audit_Code_c, that is used to specify what type of auditing the Account needs and a Lookup to User, zudizar_c, that is the assigned auditor. When an Account is initially created, the user specifies the Audit_Code c. Each User in the org has a unique text field, Audit_Code _e, that is used to automatically assign the correct user to the Account’s Auditor_c field.

PDII Question 36

What should be changed to most optimize the code’s efficiency?

Choose 2 answers

Options:

A.

Add an initial SOQL query to get all distinct audit codes.

B.

Build a Map> of audit code to accounts.

C.

Build a Map>of Account Id to audit codes.

D.

Add a WHERE clause to the SOQL query to filter on audit codes.

Buy Now
Questions 37

A developer wrote a trigger on Opportunity that will update a custom Last Sold Date

field on the Opportunity's Account whenever an Opportunity is closed. In the test

class for the trigger, the assertion to validate the Last Sold Date field fails.

What might be causing the failed assertion?

Options:

A.

The test class has not defined an Account owner when inserting the test data.

B.

The test class has not implemented seealldata=true in the test method.

C.

The test class has not re-queried the Account record after updating the Opportunity.

D.

The test class is not using System. runs () to run tests as a Salesforce administrator.

Buy Now
Questions 38

What should a developer use to query all Account fields for the Acme account in their sandbox?

Options:

A.

SELECT FIELDS FAOM Account WHERE Name = ‘Acme’ LIMIT 1

B.

SELECT FIELDS (ALL) FROM Account WHERE Name = ‘Acme’ LIMIT 1

C.

SELECT ALL FROM Account WHERE Name = "Acme’ LIMIT 1

D.

SELECT * FROM Recount WHERE Names = ‘Aeme’ LIMIT 1

Buy Now
Questions 39

Which use case can be performed only by using asynchronous Apex?

Options:

A.

Querying tens of thousands of records

B.

Making a call to schedule a batch process to complete in the future

C.

Calling a web service from an Apex trigger

D.

Updating a record after the completion of an insert

Buy Now
Questions 40

A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk.

What should be used?

Options:

A.

DML Operation

B.

Changelog

C.

Application Event

D.

Component Event

Buy Now
Questions 41

A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

PDII Question 41

How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?

Options:

A.

Add force:hasSobjectName to the implements attribute.

B.

Use the gerSubjectType method in an Apex class.

C.

Set the sObject type as a component attribute.

D.

Create a design attribute and configure via App Builder.

Buy Now
Questions 42

Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERF Number_c, that is then used in a query to find matching Accounts.

PDII Question 42

Which step should be taken to resolve the issue?

Options:

A.

Perform the SOQL query as part of a for loop.

B.

Mark the ERP_Numker = field as an external 10.

C.

Mark the ERP_Number__ c field as required.

D.

Move the SO0L query to within an asynchronous process.

Buy Now
Questions 43

A developer is asked to look into an issue where a scheduled Apex is running into DML limits. Upon investigation, the developer finds that the number of records processed by the scheduled Apex has recently increased to more than 10,000.

What should the developer do to eliminate the limit exception error?

Options:

A.

Use the @future annotation.

B.

Implement the Qususabls interface.

C.

Implement the Batchable interface.

D.

Use platform events.

Buy Now
Questions 44

A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.

What can cause this problem?

Options:

A.

The test class does not retrieve the updated value from the database,

B.

The test class does not use the Bulk API for loading test data.

C.

The test class does not use the seeallData=true= annotation.

D.

The test class does not implement the Queueable interface.

Buy Now
Questions 45

A developer is asked to replace the standard Case creation screen with a custom screen that takes users through a wizard before creating the Case. The org only has users running Lightning Experience.

What should the developer override the Case New Action with to satisfy the requirements?

Options:

A.

Lightning Page

B.

Lightning Record Page

C.

Lightning Component

D.

Lightning Flow

Buy Now
Questions 46

A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.

PDII Question 46

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?

Options:

A.

Add an within the .

B.

Add an within the .

C.

Add an within the .

D.

Add an within the .

Buy Now
Questions 47

Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called Candidate was created with organization-wide defaults set to Private. A lookup on the Candidate object sets an employee as an Interviewer.

What should be used to automatically give Read access to the record when the lookup field is set to the Interviewer user?

Options:

A.

The record can be shared using an Apex class.

B.

The record can be shared using a permission set.

C.

The record can be shared using a sharing rule.

D.

The record cannot he shared with the current setup.

Buy Now
Questions 48

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

Options:

A.

Define a method that creates test data and annotate with @testSetup.

B.

Define a method that creates test data and annotate with @createData.

C.

Ensure proper usage of test data factory in all test methods.

D.

Reduce the amount of test methods in the class.

Buy Now
Questions 49

Users report that a button on a custom Lightning web component (LWC) is not

saving the data they enter. The button looks to be clicked, but the LWC simply sits

there, seemingly doing nothing.

What should the developer use to ensure error messages are properly displayed?

Options:

A.

Add a try-catch block surrounding the DML statement.

B.

Use the Database method with a110rNone Set to false.

C.

Add the tag to the component.

D.

Add JavaScript and HTML to display an error message.

Buy Now
Questions 50

Which statement is true regarding savepoints?

Options:

A.

You can roll back to any savepoint variable created in any order.

B.

Static variables are not reverted during a rollback.

C.

Reference to savepoints can cross trigger invocations.

D.

Savepoints are not limited by DML statement governor limits.

Buy Now
Exam Code: PDII
Exam Name: Salesforce Certified Platform Developer II (SU24)
Last Update: Nov 20, 2024
Questions: 193

PDF + Testing Engine

$64  $159.99

Testing Engine

$48  $119.99
buy now PDII testing engine

PDF (Q&A)

$40  $99.99
buy now PDII pdf