Black Friday Biggest Discount Flat 70% Offer - Ends in 0d 00h 00m 00s - Coupon code: 70diswrap

Salesforce PDII Dumps

Page: 1 / 19
Total 193 questions

Salesforce Certified Platform Developer II (SU24) Questions and Answers

Question 1

When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:

System.CalloutException: Unauthorized endpoint

Which recommended approach should the developer implement

to resolve the callout exception?

Options:

A.

Annotate the getkRFCatalogContents method with @Future (Callout-true),

B.

Change the access modifier for ERPCatalog from public to global.

C.

Use the SetHeader() method to specify Basic Authentication,

D.

Create a remote site setting configuration that includes the endpoint.

Question 2

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.

Question 3

Which tag should a developer use to display different text while an is Processing an action?

Options:

A.

B.

C.

D.

Question 4

Universal Containers is using a custom Salesforce application to manage customer

support cases. The support team needs to collaborate with external partners to

resolve certain cases. However, they want to control the visibility and access to the

cases shared with the external partners. Which Salesforce feature can help achieve this requirement?

Options:

A.

Role hierarchy

B.

Criteria-based sharing rules

C.

Apex managed sharing

D.

Sharing sets

Question 5

A developer creates an application event that has triggered an infinite loop.

What may have caused this problem?

Options:

A.

The event is fired from a custom renderer.

B.

The event has multiple handlers registered in the project.

C.

The event handler calls a trigger.

D.

An event is fired ‘ontouchend'’ and is unhandled.

Question 6

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?

Options:

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

Question 7

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

Options:

A.

Identify unique fields on Order and Account and set them as External IDs.

B.

Use the insert wizard in the Data Loader to import the data.

C.

Ensure the data in the file is sorted by the order ID.

D.

Use the upsert wizard in the Data Loader to import the data.

Question 8

A company has a custom component that allows users to search for records of a

certain object type by invoking an Apex Controller that returns a list of results

based on the user's input. When the search is completed, a searchComplete event

is fired, with the results put in a results attribute of the event. The component is

designed to be used within other components and may appear on a single page

more than once.

What is the optimal code that should be added to fire the event when the search has completed?

A)

as

B)

as

C)

as

D)

as

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 9

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

class for a Visualforce controller?

Options:

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,

Question 10

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.

Question 11

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

Question 12

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.

Question 13

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?

Options:

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.

Question 14

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

Choose 3 answers

Options:

A.

B.

C.

D.

E.

Question 15

as

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)

as

B)

as

C)

as

Options:

A.

Option A

B.

Option B

C.

Option C

Question 16

A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes.

Which tool or mechanism should be utilized for managing the source-driven deployment process?

Options:

A.

Metadata API

B.

Change Sets

C.

Force.com IDE

D.

Salesforce CLI with Salesforce DX

Question 17

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

Question 18

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.

Question 19

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

as

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.

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

Question 21

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?

Options:

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.

Question 22

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.

Question 23

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)

Question 24

A Salesforce Platform Developer is leading a team that is tasked with deploying a

new application to production. The team has used source-driven development, and

they want to ensure that the application is deployed successfully.

What tool or mechanism should be used to verify that the deployment is successful?

Options:

A.

Force.com Migration Tool

B.

Salesforce DX CLI

C.

Apex Test Execution

D.

Salesforce Inspector

Question 25

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.

Question 26

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

Question 27

A software company uses a custom object, Defact__c, to track defects in their

software. Defect__c has organization-wide defaults set to private. Each Defect_ c

has a related list of Reviewer < records, each with a lookup field to User that is

used to indicate that the User will review the defect__c.

What should be used to give the User on the Reviewer_c record read only access

to the Defect__c record on the Reviewer_c record?

Options:

A.

Apex managed sharing

B.

Criteria-based sharing

C.

Lightning web component

D.

View All on Defect__c

Question 28

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?

Options:

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.

Question 29

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)

as

B)

as

C)

as

D)

as

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 30

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;

Question 31

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

as

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 .

Question 32

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

Question 33

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

Options:

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.

Question 34

Universal Containers uses Big Objects to store almost a billion customer

transactions called customer_Transaction_ b.

These are the fields on customer Transaction b:

as

The following fields have been identified as Index Fields for the Customexr_Transaction__b object: Account__g, Program__c, and Transaction Date_ co.

Which SOQL query is valid on the customer_Transaction_b Big Object?

A)

as

B)

as

Options:

A.

Option A

B.

Option B

Question 35

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?

Options:

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.

Question 36

Universal Containers (LIC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.

What should the developer use to ensure the site is multilingual?

Options:

A.

Use custom labels to ensure custom messages are translated properly.

B.

Use custom settings to ensure custom messages are translated properly.

C.

Use custom objects to translate custom picklist values.

D.

Use custom metadata to translate custom picklist values.

Question 37

A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution.

How should the developer implement error exception handling in their code to handle this?

Options:

A.

Use Database methods to obtain lists of Database.SaveResults.

B.

Use a try-catch statement and handle DML cleanup in the catch statement,

C.

Use Database.setSavepoint {} and Database.rollBack with a try-catch statement.

D.

Use a try-catch and use sObject.addError() on any failures.

Question 38

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

as

A)

as

B)

as

C)

as

D)

as

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 39

as

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.

Question 40

How can a developer efficiently incorporate multiple JavaScript libraries in an Aura component?

Options:

A.

Use JavaScript remoting and script tags.

B.

Use CDNs with script attributes.

C.

Implement the libraries in separate helper files.

D.

Join multiple assets from a static resource.

Question 41

Universal Containers is leading a development team that follows the source-driven development approach in Salesforce. As part of their continuous integration and delivery (CL/CD) process, they need to automatically deploy changes to multiple environments, including sandbox and production.

‘Which mechanism or tool would best support their CI/CD pipeline in source-driven development?

Options:

A.

Salesforce CLI with Salesforce DX

B.

Salesforce Extensions for Visual Studio Code

C.

Change Sets

D.

Ant Migration Tool

Question 42

A developer created 2 class that implements the Queueable Interface, as follows:

as

As part of the deployment process, the developer is asked to create a corresponding test class.

Which two actions should the developer take to successfully execute the test class?

Choose 2 answers

Options:

A.

Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.

B.

Ensure the running user of the test class has, at I the View All permission on the Order object.

C.

Enclose System.enqueueJob(new OrderQueueableJob ()] within Tess. and Test .stopTest (1.

D.

Implement Test. isRunningTest() to prevent chaining jobs during test execution.

Question 43

A developer is building a Lightning web component that searches

for Contacts. The component must communicate the search

results to other unrelated Lightning web components, that are in

different DOM trees, when the search completes.

What should the developer do to implement the communication?

Options:

A.

Fire an application event.

B.

Publish an event on an event channel.

C.

Fire a custom component event.

D.

Publish a message on a message channel.

Question 44

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

Options:

A.

Lightning web component

B.

2 Apex method that returns a Continuation object

C.

Screen Flow

D.

Process Builder

Question 45

For compliance purposes, a company is required to track long-term product usage in their org. The information that they need to log will be collected from more than one object and, over time, they predict they will have hundreds of millions of records.

What should a developer use to implement this?

Options:

A.

Setup audit trail

B.

Field audit trail

C.

Big objects

D.

Field history tracking

Question 46

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?

Options:

A.

Apex REST web service

B.

Apex SOAP web service

C.

Apex SOAP callout

D.

Apex REST callout

Question 47

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.

Question 48

A developer is tasked with creating a Lightning web component that is responsive on various devices,

Which two components should help accomplish this goal?

Choose 2 answers

Options:

A.

lightning-navigation

B.

Lightning-input-location

C.

Lightning-layout

D.

lightning-layout—-item

Question 49

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.

Question 50

In an organization that has multi-currency enabled, a developer Is tasked with building a Lighting component that displays the top ten Opportunities most recently accessed by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.

What is the most effective approach to ensure values displayed respect the user's locale settings?

Options:

A.

Use REGEX expressions to format the values retrieved via SOQL.

B.

Use a wrapper class to format the values retrieved via SOQL.

C.

Use the FOR VIEW clause in the SOQL query.

D.

Use the FORMAT () function in the SOQL query.

Page: 1 / 19
Total 193 questions