Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Salesforce PDII - Salesforce Certified Platform Developer II (Plat-Dev-301)

Page: 6 / 6
Total 202 questions

Consider the below 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?

Choose 2 answers

A.

B.

C.

D.

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?

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.

What are three reasons that a developer should write Jest tests for Lightning web components?

Choose 3 answers

A.

To test a component's non-public properties.

B.

To test basic user interaction

C.

To verify the DOM output of a component

D.

To test how multiple components work together

E.

To verify that events fire when expected

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 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.

A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions.

When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information.

Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message.

Depending on company personnel resources, what are two ways to automate this?

Choose 2 answers

A.

Remote action

B.

Flow Builder

C.

Apex trigger

D.

Apex invocable method

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

A developer is writing a Jest test for a Lightning web component that conditionally displays child components based on a user's checkbox selections.

What should the developer do to properly test that the correct components display and hide for each scenario?

A.

Create a new describe block for each test.

B.

Reset the DOM after each test with the after Each() method.

C.

Add a teardown block to reset the DOM after each test.

D.

Create a new jsdom instance for each test.

Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page.

What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?

A.

use System. profiles=() to test as a sales rep and a community user.

B.

use System. profiles() to test as an administrator and a community user.

C.

use System. profiles1h=() to test as a sales rep and a community user.

D.

use System. runsAs () to test as an administrator and a community user.

A company has a web page that needs to get Account record information, such as name, website, and employee number. The Salesforce record 1D is known to the web page and it uses JavaScript to retrieve the account information.

Which method of integration is optimal?

A.

Apex SOAP web service

B.

SOAP API

C.

Apex REST web service

D.

REST API

What is a benefit of JavaScript remoting over Visualforce Remote Objects?

A.

Does not require any JavaScript code

B.

Supports complex server-side application logic

C.

Does not require any Apex code

D.

Allows for specified re-render targets