Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Pass the Salesforce Developers PDII Questions and answers with ValidTests

Exam PDII All Questions
Exam PDII Premium Access

View all detail and faqs for the PDII exam

Viewing page 2 out of 5 pages
Viewing questions 11-20 out of questions
Questions # 11:

A user receives the generic "An internal server error has occurred” while interacting

with a custom Lightning component.

What should the developer do to ensure a more meaningful message?

Options:

A.

Add an onerror event handler to the tag.

B.

Add an error-view component to the markup.

C.

Use platform events to process the error

D.

Use an AuraHandledexception in a try-catch block.

Expert Solution
Questions # 12:

A developer is creating a page in App Builder that will be used in the Salesforce mobile app.

Which two practices should the developer follow to ensure the page operates with optimal performance?

Choose 2 answers

Options:

A.

Limit 25 fields on the record detail page.

B.

Limit the number of Tabs and Accordion components.

C.

Analyze the page with Performance Analysis for App Builder.

D.

Limit five visible components on the page.

Expert Solution
Questions # 13:

Question # 13

Consider the above trigger intended to assign the Account to the manager of the Account's region,

Which two changes should a developer make in this trigger to adhere to best practices?

Options:

A.

Use a Map to cache the results of the Region._c query by Id.

B.

Move the Region__c query to outside the loop.

C.

Use a Map accountMap instead of List accountList.

D.

Remove the last line updating accountList as It Is not needed.

Expert Solution
Questions # 14:

A developer created an Apex class that updates an Account based on input from a Lightning web component that Is used to register an Account. The update to the Account should only be made if it has not already been registered.

Question # 14

What should the developer do to ensure that users do not overwrite each other's updates to the same Account if they make updates at the same time?

Options:

A.

B.

C.

D.

Expert Solution
Questions # 15:

A developer gets an error saying ‘Maximum Trigger Depth Exceeded.’

What is a possible reason to get this error message?

Options:

A.

A trigger is recursively invoked more than 16 times.

B.

The SOQL governor limits are being hit.

C.

There are numerous DML operations in the trigger logic.

D.

A flow trigger was included too many times.

Expert Solution
Questions # 16:

A company has many different unit test methods that create Account records as

part of their data setup. A new required field was added to the Account and now all

of the unit tests fail.

What is the optimal way for a developer to fix the issue?

Options:

A.

Add the required field to the data setup for all of the unit tests.

B.

Add a before insert trigger on Account to set the value of the required field,

C.

Change the required field to be a validation rule that excludes the System Administrator profile.

D.

Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

Expert Solution
Questions # 17:

When developing a Lightning web component, which setting displays lightninglayout-items im one column on small devices, such as mobile phones, and in two

columns on tablet-size and desktop-size screens?

Options:

A.

Set size="12" tablet-device-size="6"

B.

Set size="12" medium-device-size="6"

C.

Set size="6" mobile-device-size="12"

D.

Set size="6" small-device-size="12"

Expert Solution
Questions # 18:

A developer created a Lightning web component that uses a Lightning_record_edit_fom to collect Information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.

Which best practice should the developer use to perform the validations on more than one held, thus allowing more than one error message to be displayed simultaneously?

Options:

A.

Apex REST

B.

Client_side validation

C.

Custom validation rules

D.

Next Best Action

Expert Solution
Questions # 19:

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?

Options:

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 Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.

C.

Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.

D.

Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.

Expert Solution
Questions # 20:

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?

Options:

A.

Turn off triggers, flows, and validations when running tests.

B.

Move the prerequisite reference data setup to a TestDataFactory and call that from each test method,

C.

Move the prerequisite reference data setup to a @testSetup method in the test class.

D.

Move the prerequisite reference data setup to the constructor for the test class.

Expert Solution
Viewing page 2 out of 5 pages
Viewing questions 11-20 out of questions