Labour Day Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: scxmas70

PDII Exam Dumps - Salesforce Certified Platform Developer II (SP23)

Question # 4

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

Full Access
Question # 5

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 6

A Lightning web component exists in the system and displays information about the record in context as a medal. Salesforce administrators need to use this component

within the Lightning App Builder,

Which two settings should the developer configure within the xml resource file?

Choose 2 answers

A.

Specify the target to be lightning_RecordPage

B.

Set the IsExposed=d attribute to true.

C.

Specify the target to be lightning_AppPage

D.

Set the IsVisible attribute to true

Full Access
Question # 7

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.

Query the FirstDayofweek field from the Locale for the current user.

B.

Import the @salesforce/i18n module and use

the firstdayofweek internationalization property.

C.

Use a custom metadata type to store key/value pairs.

D.

Use UserInfo.getLocale() in the component.

Full Access
Question # 8

A company needs to automatically delete sensitive information after seven years.

This could delete almost a million records every day.

How can this be achieved?

A.

Schedule an 3fuzure process to query records older than seven years, and then recursively invoke itself in 1,000 record batches to delete them,

B.

Use aggregate functions to query for records older than seven years, and then delete the aggrigateResults objects.

{civ [+] Schedule a batch Apex process to run every day that queries and deletes records older than seven years.

C.

Perform a SOSL statement to find records older than 7 years, and then delete the entire result set.

Full Access
Question # 9

Which interface needs to be implemented by an Aura component so that it may be displayed in modal dialog by clicking a button on a Lightning record page?

A.

farce:lightningEditRAation

B.

lightning:editiction

C.

force:lightningQuickhction

D.

lightning:quickAction

Full Access
Question # 10

Refer to the following code snippet:

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain criteria are met.

Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?

Choose 3 answers

A.

Annotate the Apex method with @AuraEnabled.

B.

Implement the with sharing keyword in the class declaration.

C.

Implement the with keyword in the class declaration.

D.

Use the WZ E D clause within the SOQL query.

E.

Annotate the Apex method with @AuraEnabled(Cacheable=True).

Full Access
Question # 11

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?

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.

Full Access
Question # 12

A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a

JSON format.

Which is the optimal method to implement this in Salesforce?

A.

Apex REST web service

B.

Apex SOAP web service

C.

Apex SOAP callout

D.

Apex REST callout

Full Access
Question # 13

Refer to the test method below''

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)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 14

Given the following information regarding Universal Containers (UC):

* UC represents their customers as Accounts in Salesforce.

* All customers have a unique Customer__Number_c that is unique across all of UC's systems.

* UC also has a custom Invoice c object, with a Lookup to Account, to represent invoices that are sent out from their external system.

UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time.

What is the optimal way to implement this?

A.

Ensure Customer Number cis an External ID and that a custom field Invoice Number cis an External ID and Upsert invoice data nightly.

B.

Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.

C.

Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly,

D.

Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.

Full Access
Question # 15

Which statement is considered a best practice for writing bulk safe Apex triggers?

A.

Add records to collections and perform DML operations against these collections.

B.

Add LIMIT 50000 to every SOQL statement.

C.

Perform all DML operations from within a future method.

D.

Use the Database methods with allorNone set to £21s= instead of DML statements.

Full Access
Question # 16

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?

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.

Full Access
Question # 17

Recently, users notice that fields that were recently added for one department suddenly disappear without warning.

Which two statements are true regarding these issues and resolution?

Choose 2 answers

A.

A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.

B.

Page Layouts should never be deployed via Change Sets, as this causes Field-Level Security to be reset and fields to disappear.

C.

The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts in production.

D.

The administrators are deploying their own Change Sets, thus deleting each other's fields from the objects in production.

Full Access
Question # 18

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.

What should the developer ensure to correct these errors?

A.

Ensure queries do net exceed governor limits,

B.

Ensure properties are marked as private,

C.

Ensure variables are marked as transient.

D.

Ensure profiles have access to the Visualforce page.

Full Access
Question # 19

A developer created a Lightning web component that uses a lightning-record-edit-form 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.

What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

A.

Try/catch/finally block

B.

External JavaScript library

C.

Validation rules

D.

Apex trigger

Full Access
Question # 20

Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Product__c, on the Account object that allows sales reps to specify which of UC’s products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Product_c field.

What should the developer do to ensure the value of Products__c is in the current user's language?

A.

Use tolabel ducts__c) in the fields list of the SOQL query.

B.

Set the locale on each record in the SOQL result list.

C.

Call the translate method on each record in the SOQL result list.

D.

Use the Locale clause in the SOQL query.

Full Access
Question # 21

Assuming the CreateOneAccount class creates one account and implements the

Queueable interface, which syntax properly tests the Apex code?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 22

A page throws an ‘Attempt to dereference a null object’ error for a Contact.

What change in the controller will fix the error?

A.

Declare a static final Contact at the top of the controller.

B.

(o] Use a condition in the getter to return a new Contact if it is null.

G Change the setter’s signature to return a Contact.

C.

Change the getter's signature to be static Contact.

Full Access
Question # 23

What is the optimal way to fix this?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 24

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?

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.

Full Access
Question # 25

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 certain conditions are met.

What is the optimal way to accomplish this?

A.

Use an Email Alert with Flow Builder.

B.

Use MassEmailMEssage () With an Apex trigger.

C.

Use a Workflow Email Alert.

D.

Use SingleEmailMessage() with an Apex trigger.

Full Access
Question # 26

A developer has a requirement to query three fields (Id, Name, Type) from an Account; and first and last names for all Contacts associated with the Account.

Which option is the preferred, optimized method to achieve this for the Account named ‘Ozone Electronics’?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 27

A developer created the following test method:

The developer org has five accounts where the name starts with “Test”. The developer executes this test in the Developer Console.

After the test code runs, which statement is true?

A.

The test will fail.

B.

There will be no accounts where the name starts with "Test".

C.

There will be five accounts where the name starts with "Test".

D.

There will be six accounts where the name starts with "Test".

Full Access
Question # 28

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?

A.

Custom objects

B.

Custom settings

C.

Custom metadata

D.

Custom labels

Full Access
Question # 29

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?

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.

Full Access
Question # 30

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?

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.

Full Access
Question # 31

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?

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

Full Access
Question # 32

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?

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.

Full Access
Question # 33

Business rules require a Contact ta always be created when a new Account is created.

What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

A.

Use setSaverpoint (1) and rollback() with a try-catch block.

B.

Use the Database. Insect method with a11orNone SEL LO alee,

C.

Use the Database. Delete method if the Contact insertion fails.

D.

Disable validation rules on Contacts and set default values with a trigger.

Full Access
Question # 34

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

There will be no error and all updates will succeed, since the limit on the number of records processed by DML statements was not exceeded.

B.

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.

C.

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.

D.

The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.

Full Access
Question # 35

What is the correct way to fix this?

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.

Full Access
Question # 36

Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users, Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business,

One of the requirements is to allow certain community users within the same

Account hierarchy to see several departments’ containers, based on a custom

junction object that relates the Contact to the various Account records that

represent the departments.

Which solution solves these requirements?

A.

A Visualforce page that uses a custom controller that specifies without sharing [0 expose the records

B.

An Apex trigger that creates Apex managed sharing records based on the junction object's relationships

C.

A Lightning web component on the Community Home Page that uses Lightning Data Services.

D.

A custom list view on the junction object with filters that will show the proper records based on owner

Full Access
Question # 37

Refer to the test method below:

The test method calls an @future method that increments the

Number_of_Times_Viewed__c value. The assertion is failing because the

Number of Times Viewed_c equals 0.

What is the optimal way to fix this?

A.

Change the assertion to system.asserciquals (0, acctAfter Number _Cf_Timea_Viewed__c).

B.

Add Test.atartTeat() before and Teat.stopTest() after inser= acct.

C.

Add rest.staztTest() before and Test.stopTess() after AuditUcil.incrementViewed.

D.

Change the initialization to acct. Number_Of_Times_Viewed_c = 1.

Full Access
Question # 38

A developer needs to store variables to control the style and behavior of a Lightning Web Component.

Which feature can be used to ensure that the variables are testable in both Production and all Sandboxes?

A.

Custom setting

B.

Custom object

C.

Custom variable

D.

Custom metadata

Full Access
Question # 39

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

A)

B)

C)

A.

Option A

B.

Option B

C.

Option C

Full Access
Question # 40

Consider the queries in the options below and the following Information:

* For these queries, assume that there are more than 200,000 Account records.

* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.

* There are two fields that are marked as External Id on the

Account. These fields are customer_Number_c and ERR_Key_ s.

Which two queries are optimized for large data volumes?

Choose 2 answers

A.

SELECT I4 FROM Account WHERE Name !— NULL

B.

SELECT 1d FROM Accounts WHERE Name != '°

AND Customer_Number_c- "ValueA’

C.

SELECT ID FROM Account WHRE id IN :aListVariable

D.

SELECT Id FROM Account WHERE Name != ‘ ‘AND IsDeleted = false

Full Access
Question # 41

Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations.

When a customer service agent enters the credit card information, it must be sent

to 8 3rd-party payment processor for the donation to be processed, UC uses one

payment processor for individuals and a different one for corporations.

What should a developer use to store the payment processor settings for the

different payment processors, so that their system administrator can modify the

settings once they are deployed, if needed?

A.

Custom object

B.

Custom metadata

C.

Hierarchy custom setting

D.

List custom setting

Full Access
Question # 42

An org records customer order information in a custom object, ordar__c, that has

fields for the shipping address. A developer is tasked with adding code to calculate

shipping charges on an order, based on a flat percentage rate associated with the

region of the shipping address.

What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?

A.

Custom hierarchy setting

B.

Custom metadata type

C.

Custom list setting

D.

Custom object

Full Access
Question # 43

A company has a custom object, Order__c, that has a custom picklist field, Status__c, with values of ‘New,' 'In Progress,’ or ‘Fulfilled’ and a lookup field,

Contact__c, to Contact.

Which SOQL query will return a unique list of all the Contact records that have no ‘Fulfilled’ Orders?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 44

How should a developer assert that a trigger with an asynchronous process has successfully run?

A.

Create all test data in the test class, use system. runs {} to invoke the trigger, then perform assertions.

B.

Insert records into Salesforce, use seeAllData=true, then perform assertions.

C.

Create all test data, use future in the rest class, then perform assertions.

D.

Create all test data in the test class, invoke Test.startTest{} and Test.etopTaat {} and then perform assertions.

Full Access
Question # 45

A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact.

Assuming the Name field exists, how should the developer do this?

A.

Cast each object into an sObject and use sObject.get to compare the Name fields,

B.

describe) function to compare the values of each Name field.

C.

Use the Salesforce Metadata API to extract the value of each object and compare the Name fields.

D.

Use a string. Replace () method to parse the contents of each Name field and then compare the results.

Full Access
Question # 46

A Visuzlforce page loads slowly due to the large amount of data it displays.

Which strategy can a developer use to improve the performance?

A.

Use lazy loading to load the data on demand, instead of in the controller's constructor.

B.

Use an

C.

Use the transient keyword for the List variables used in the custom controller.

D.

Use Javascript to move data processing to the browser instead of the controller.

Full Access
Question # 47

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.

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 48

How should a developer verify that a specific Account record is being tested in a test

class for a Visualforce controller?

A.

Insert the Account in the test class, instantiate the page reference in the test class, then use System.currentFageReference() .getFarameters() .put{) to set the Account ID.

B.

Insert the Account into Salesforce, instantiate the page reference in the test class, then use system. setFarentRecordId() .get() to set the Account ID.

{of Instantiate the page reference in the test class, insert the Account in

the test class, then use =seeAllData=trus to view the Account.

C.

Instantiate the page reference in the test class, insert the Account in

the test class, then use system.setFarentRecordrd() .get() to set the Account ID,

Full Access
Question # 49

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

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

Full Access
Question # 50

Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates?

Choose 3 answers

A.

B.

C.

D.

E.

Full Access