New Year Special Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

Salesforce PDI Salesforce Certified Platform Developer I (SU24) Exam Practice Test

Page: 1 / 17
Total 174 questions

Salesforce Certified Platform Developer I (SU24) Questions and Answers

Question 1

A developer is creating a Lightning web component to show a list of sales records.

The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field.

How should this be enforced so that the component works for both users without showing any errors?

Options:

A.

Use with 8ECTOITYJ2WFORCED in the SOQL that fetches the data for the component.

B.

Use Lightning Locker Service to enforce sharing rules and field-level security.

C.

Use Lightning Data Service to get the collection of sales records.

D.

Use security.stripinaccessible to remove fields inaccessible to the current user.

Question 2

Refer to the following Apex code:

Question # 2

What is the value of x when it is written to the debug log?

Options:

A.

0

B.

1

C.

2

D.

3

Question 3

The following Apex method is part of the Contactservice class that is called from a trigger:

Question # 3

How should the developer modify the code to ensure best practices are met?

A)

Question # 3

B)

Question # 3

C)

Question # 3

D)

Question # 3

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 4

Universal Containers has implemented an order management application. Each Order can have one or more Order Line items. The Order Line object is related to the Order via a master-detail relationship. For each Order Line item, the total price is calculated by multiplying the Order Line item price with the quantity ordered.

What is the best practice to get the sum of all Order Line item totals on the Order record?

Options:

A.

Quick action

B.

Apex trigger

C.

Roll-up summary field

D.

Formula field

Question 5

A developer is migrating a Visualforce page into a Lightning web component.

Salesforce Certified Platform Developer I

The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.

Which security consideration should the developer be aware of?

Options:

A.

The isaccessisle() method must be used for field-level access checks.

B.

Lightning Data Service ignores field-level security.

C.

The with sharing keyword must be used to enforce sharing rules.

D.

Lightning Data Service handles sharing rules and field-level security.

Question 6

A developer completed modifications to a customized feature that is comprised of two elements:

* Apex trigger

* Trigger handler Apex class

What are two factors that the developer must take into account to properly deploy the modification to the production environment?

Choose 2 answers

Options:

A.

All methods in the test classes must use @isTest.

B.

Apex classes must have at least 75% code coverage org-wide.

C.

Test methods must be declared with the testMethod keyword.

D.

At least one line of code must be executed for the Apex trigger.

Question 7

What are three ways for a developer to execute tests in an org?

Choose 3 answers

Options:

A.

Setup Menu

B.

Tooling API

C.

Metadata API

D.

Salesforce DX

E.

Bulk APL

Question 8

What are two considerations for deploying from a sandbox to production? Choose 2 answers

Options:

A.

Should deploy during business hours to ensure feedback can be quickly addressed.

B.

All triggers must have at least one line of test coverage.

C.

least 75% of Apex code must be covered by unit tests.

D.

Unit tests must have calls to the System.assert method.

Question 9

Which two are best practices when it comes to Aura component and application event handling?

Choose 2 answers

Options:

A.

Try to use application events as opposed to component events.

B.

Use component events to communicate actions that should be handled at the application level.

C.

Handle low-level events in the event handler and re-fire them as higher-level events.

D.

Reuse the event logic in a component bundle, by putting the fogic in the helper.

Question 10

A developer is asked to write helper methods that create test data for unit tests.

Question # 10

What should be changed in the TestUtils class so that its methods are only usable by unit test methods?

Options:

A.

Remove static from line 03.

B.

Add @IsTest above line 03.

C.

Change public to private on line 01.

D.

Add @1sTest above line 01.

Question 11

A developer created a Visualforce page and custom controller to display the account type field as shown below.

Custom controller code:

Question # 11

Visualforce page snippet:

Question # 11

what should the developer do to correct the problem?

Options:

A.

Add a getter method for the attribute.

B.

Convert theAccount.Type to a String.

C.

Change theAccount attribute to public.

D.

Add with sharing to the custom controller.

Question 12

A developer created this Apex trigger that calls MyClass.myStaticMsthod:

Question # 12

The developer creates a test class with a test method that calls Myclass.myStacicMethod directly, resulting in 81% overall code coverage.

What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?

What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?

Options:

A.

The deployment falls because no assertions were made in the test method.

B.

The deployment passes because both classes and the trigger were included in the deployment.

C.

The deployment fails because the Apex trigger has no code coverage.

D.

The deployment passes because the Apex code has the required =75% code coverage.

Question 13

A developer created a trigger on a custom object. This custom object also has some dependent pick lists.

According to the order of execution rules, which step happens first?

Options:

A.

Old values are overwritten with the new record values.

B.

JavaScript validation is run in the browser,

C.

System validation is run for maximum field lengths,

D.

The original record Is loaded from the database.

Question 14

What should a developer do to check the code coverage of a class after running all tests?

Options:

A.

View the Class Test Percentage tab on the Apex Class list view in Salesforce Setup.

B.

View the code coverage percentage for the class using the Overall Code Coverage panel in the Developer Console Tests tab,

C.

View the Code Coverage column in the list view on the Apex Classes page.

D.

Select and run the class on the Apex Test Execution page in the Developer Console.

Question 15

Universal Containers decides to use purely declarative development to build out a new Salesforce application.

Which two options can be used to build out the business logic layer for this application?

Choose 2 answers

Options:

A.

Validation Rules

B.

Remote Actions

C.

Record-Triggered Flow

D.

Batch Jobs

Question 16

Universal Containers wants to automatically assign new cases to the appropriate support representative based on the case origin. They have created a custom field on the Case object to store the support

representative name.

What is the best solution to assign the case to the appropriate support representative?

Options:

A.

Use a validation rule on the Case object.

B.

Use an Assignment Flow element.

C.

Use a trigger on the Case object.

D.

Use a formula field on the Case object.

Question 17

A developer identifies the following triggers on the Expense__c object:

Question # 17

The triggers process before delete, before insert, and before update events respectively.

Which two techniques should the developer implement to ensure trigger best practices are followed?

Choose 2 answers

Options:

A.

Unify all three triggers in a single trigger on the expense__c object that includes all events.

B.

Create helper classes to execute the appropriate logic when a record is saved.

C.

Maintain all three triggers on the expense__c object, but move the Apex logic out of the trigger definition.

D.

Unify the before insert and before update triggers and use Flow for the delete action.

Question 18

A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org.

Which tool should the developer use to troubleshoot query performance?

Options:

A.

Setup Menu

B.

Developer Console

C.

Visual Studio Code IDE

D.

AppExchange

Question 19

A developer created these three Rollup Summary fields in the custom object, project_ c:

Question # 19

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.

Which should the developer use to implement the business requirement in order to minimize maintenance overhead?

Options:

A.

Apex trigger

B.

Roll-up summary field

C.

Formula field

D.

Record-triggered flow

Question 20

A developer wants to import 500 Opportunity records into a sandbox.

Why should the developer choose to use Data Loader instead of Data Import Wizard?

Options:

A.

Data Import Wizard does not support Opportunities.

B.

Data Loader automatically relates Opportunities to Accounts.

C.

Data Loader runs from the developer's browser,

D.

Data Import Wizard can not import all 500 records.

Question 21

Which two are phases in the Aura application event propagation framework?

Choose 2 answers

Options:

A.

Bubble

B.

Control

C.

Default

D.

Emit

Question 22

A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunitylLineltem trigger.

Which method allows access to the price book?

Options:

A.

Use @IaTest (SeeAllData=true) and delete the existing standard price book,

B.

Use Test.loadData() and a static resource to load a standard price book,

C.

Use @TestVisible to allow the test method to see the standard price book.

D.

Use Teat.getStandardPricebookId() to get the standard price book 1D.

Question 23

When importing and exporting data into Salesforce, which two statements are true? Choose 2 answers

Options:

A.

Developer and Developer Pro sandboxes have different storage limits.

B.

Bulk API can be used to bypass the storage limits when importing large data volumes in development environments.

C.

Bulk API can be used to import large data volumes in development environments without bypassing the storage limits.

D.

Data import wizard is an application that is instalied on your computer.

Question 24

What are two benefits of using External IDs? Choose 2 answers

Options:

A.

An External ID field can be used to reference an ID from another external system.

B.

External ID is indexed and can improve the performance of SOQL queries.

C.

An External ID can be used with Salesforce Mobile to make external data visible.

D.

An External ID can be a formula field to help create a unique key from two fields in Salesforce.

Question 25

Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.

Question # 25

When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce

page.

What can the developer use to meet this business requirement?

Options:

A.

Controller extension

B.

Custom controller

C.

Apex trigger

D.

Validation rule

Question 26

The Account object in an organization has a master-detail relationship to a child object called Branch. The following automations exist:

Roll-up summary fields

Custom validation rules

Duplicate rules

developer created a trigger on the Account object.

Which two things should the developer consider while testing the trigger code?

Choose 2 answers

Options:

A.

Rollup summary fields can cause the parent record to go through Save.

B.

The validation rules will cause the trigger to fire again,

C.

Duplicate rules are executed once all DML operations commit to the database.

D.

The trigger may fire multiple times during a transaction.

Question 27

Which two characteristics are true for Lightning Web Component custom events? Choose 2 answers

Options:

A.

Data may be passed in the payload of a custom event using a property called detail.

B.

By default a custom event only propagates to its immediate container and to its immediate child component.

C.

Data may be passed in the payload of a custom event using @wire decorated properties.

D.

By default a custom event only propagates to its immediate container.

Question 28

A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat:

Question # 28

What are two ways the developer can update the method to prevent a SOQL injection attack?

Choose 2 answers

Options:

A.

Use a regular expression expression on the parameter to remove special characters,

B.

Use the escapeSingleQuotes method to sanitize the parameter before its use.

C.

Use variable binding and replace the dynamic query with a static SOQL.

D.

Use the @Readonly annotation and the with sharing keyword on the class

Question 29

A developer needs to prevent the creation of Request__c records when certain conditions exist in the system. A RequestLogic class exists that checks the conditions.

What is the correct implementation?

A)

Question # 29

B)

Question # 29

C)

Question # 29

D)

Question # 29

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 30

Universal Containers (UC) uses out-of-the-box order management, that has a Master-Detail relationship between Order and Order Line Item.

UC stores the availability date on each Order Line Item and Orders are only shipped when all of the Order Line Items are available.

Which method should be used to calculate the estimated ship date for an Order?

Options:

A.

Use a MAX Roll-Up Summary field on the latest availability date fields.

B.

Use a CEILING formula on each of the latest availability date fields.

C.

Use a LATEST formula on each of the latest availability date fields.

D.

Use a DAYS formula on each of the availability date fields and a COUNT Roll-Up Summary field on the Order.

Question 31

A developer created a new after insert trigger on the Lead object that creates Task records for each Lead.

After deploying to production, an existing outside integration that inserts Lead records in batches to Salesforce is occasionally reporting total batch failures being caused by the Task insert statement. This causes the integration process in the outside system to stop, requiring a manual restart.

Which change should the developer make to allow the integration to continue when some records in a batch cause failure due to the Task insert statement, so that manual restarts are not needed?

Options:

A.

Deactivate the trigger before the integration runs.

B.

Remove the Apex class from the integration user's profile,

C.

Use a try-catch block after the insert statement,

D.

Use the Database method with allOrNone set to false.

Question 32

What are three considerations when using the @InvocableMethod annotation in Apex?

Choose 3 answers

Options:

A.

Only one method using the @InvocableMethod annotation can be defined per Apex class.

B.

A method using the @InvocableMathod annotation must define a return value,

C.

A method using the @InvocableMethod annotation can have multiple input parameters.

D.

A method using the @InvocablsMethod annotation must be declared as static.

E.

A method using the @InvocableMathod annotation can be declared as Public Global.

Question 33

Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.

What are two characteristics of declarative development over programmatic customization?

Choose 2 answers

Options:

A.

Declarative code logic does not require maintenance or review.

B.

Declarative development has higher design limits and query limits.

C.

Declarative development does not require Apex test classes.

D.

Declarative development can be done using the Setup menu.

Question 34

What can be used to override the Account's standard Edit button for Lightning Experience?

Options:

A.

Lightning component

B.

Lightning action

C.

Lightning flow

D.

Lightning page

Question 35

team of developers is working on a source-driven project that allows them to work independently, with many different org configurations.

Which type of Salesforce orgs should they use for their development?

Options:

A.

Full Copy sandboxes

B.

Developer orgs

C.

Developer sandboxes

D.

Scratch orgs

Question 36

Assuming that name is a String obtained by an tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection? Choose 2 answers

A)

Question # 36

B)

Question # 36

C)

Question # 36

D)

Question # 36

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 37

Which code in a Visualforce page and/or controller might present a security vulnerability?

A)

Question # 37

B)

Question # 37

C)

Question # 37

D)

Question # 37

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 38

How many Accounts will be inserted by the following block of code?

Question # 38

Options:

A.

100

B.

0

C.

500

D.

150

Question 39

How does the Lightning Component framework help developers implement solutions faster?

Options:

A.

By providing change history and version control

B.

By providing an Agile process with default steps

C.

By providing device-awareness for mobile and desktops

D.

By providing code review standards and processes

Question 40

A developer is creating an app that contains multiple Lightning web components.

One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page.

How should this be accomplished?

Options:

A.

Update a property on the parent.

B.

Fire a notification.

C.

Create a custom event,

D.

Call a method in the Apex controller.

Question 41

Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering_Support__ c.

Users should be able to associate multiple Engineering_ support___c records to a single Opportunity record. Additionally, aggregate information about the Engineering Support__ c records should be shown on the Opportunity record.

Which relationship field should be implemented to support these requirements?

Options:

A.

Lookup field from Opportunity to Engineering_Support__c

B.

Master-detail field from Engine=ring Support__c to Opportunity

C.

Master-detail field from Opportunity to Engineering_Supports__c

D.

Lookup field from Engineering Support__c to Opportunity

Question 42

A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record.

How can the developer find the current user's default record type?

Options:

A.

Use Opportunity.SObjectType.gethescribe () .getRaecordlypaInsos () to get a list of record types, and iterate through them until 2sDefaultRecordTypeMapping () is true.

B.

Query the Profile where the ID equals uzexInfo.getProfilelD () and then use the profile.Cpportunity.gesDefaultRecordTyp= () method.

C.

Use the Schema.userInfo.Cpportunity.getlefaultRecordIype () method.

D.

Create the opportunity and check the opportunity. recordTyp=, which will have the record ID of the current user's default record type, before inserting.

Question 43

Which two actions may cause triggers to fire?

Choose 2 answers

Options:

A.

Cascading delete operations

B.

Changing a user's default division when the transfer division option is checked

C.

Updates to FeedItem

D.

Renaming or replacing a picklist entry

Question 44

Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional

layer of validation using automation.

What would be the best solution for this requirement?

Options:

A.

Use an Approval Process to enforce the completion of a valid email address using an outbound message action,

B.

Submit a REST API Callout with a JSON payload and validate the fields on a third party system

C.

Use a custom Lightning Web component to make a callout to validate the fields on a third party system.

D.

Use a before-save Apex trigger on the Lead object to validate the email address and display an error message if it is invalid

Question 45

Given the following Anonymous block:

Question # 45

What should a developer consider for an environment that has over 10,000 Case records?

Options:

A.

The try-catch block will handle any DML exceptions thrown.

B.

The transaction will fail due to exceeding the governor limit.

C.

The try-catch block will handle exceptions thrown by governor limits.

D.

The transaction will succeed and changes will be committed.

Question 46

What does the Lightning Component framework provide to developers?

Options:

A.

Prebuilt components that can be reused

B.

Support for Classic and Lightning Uls

C.

Extended governor limits for applications

D.

Templates to create custom components

Question 47

Which statement describes the execution order when triggers are associated to the same object and event?

Options:

A.

Triggers are executed in the order they are modified.

B.

Triggers are executed alphabetically by trigger name.

C.

Triggers are executed in the order they are created.

D.

Trigger execution order cannot be guaranteed.

Question 48

A developer wrote Apex code that calls out to an external system using REST API.

How should a developer write the test to prove the code is working as intended?

Options:

A.

Write a class that implements WebServiceMock.

B.

Write a class that extends HTTPCalloutMock.

C.

Write a class that extends WerServiceMack.

D.

write a class that implements HTTPCalloutMock.

Question 49

What are three characteristics of change set deployments?

Choose 3 answers

Options:

A.

Change sets can deploy custom settings data.

B.

Change sets can be used to transfer records.

C.

Deployment is done in a one-way, single transaction.

D.

Sending a change set between two orgs requires a deployment connection.

E.

Change sets can only be used between related organization

Question 50

Which annotation should a developer use on an Apex method to make it available to be wired to a property in a Lightning web component?

A)

Question # 50

B)

Question # 50

C)

Question # 50

D)

Question # 50

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 51

A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces.

Question # 51

Which is the correct implementation?

A)

Question # 51

B)

Question # 51

Options:

A.

Option A

B.

Option B

Question 52

Which three Salesforce resources can be accessed from a Lightning web component?

Choose 3 answers

Options:

A.

All external libraries

B.

SVG resources

C.

Third-party web components

D.

Content asset files

E.

Static resources

Page: 1 / 17
Total 174 questions