Summer Sale Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 28522818

Home > Salesforce > Developers > PDI

PDI Salesforce Certified Platform Developer I (SU24) Question and Answers

Question # 4

A Primaryid__c custom field exists on the candidate_ c custom object. The field is used to store each candidate's id number and is marked as Unique in the schema definition.

As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's primary id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system.

Which technique should the developer implement to streamline the data upload?

A.

Create a before Insert trigger to correctly map the records.

B.

Create a before save flow to correctly map the records.

C.

Update the PrimaryId__ c field definition to mark it as an External Id.

D.

Upload the CSV into a custom object related to Candidate__ c.

Full Access
Question # 5

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

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.

Full Access
Question # 6

A developer wants to improve runtime performance of Apex calls by caching results on the client.

What is the most efficient way to implement this and follow best practices?

A.

Call the setStorable () method on the action in the JavaScript client-side code.

B.

Set a cookie in the browser for use upon return to the page.

C.

Decorate the server-side method with @AuraEnsbled(storable=true).

D.

Decorate the server-side method with @AuraZnabled(cacheable=true).

Full Access
Question # 7

Managers at Universal Containers want to ensure that only decommissioned containers are able to be deleted in the system. To meet the business requirement a Salesforce developer adds "Decommissioned” as a picklist value for the status__c custom field within the Container__c object.

Which two approaches could a developer use to enforce only Container records with a status of "Decommissioned” can be deleted?

Choose 2 answers

A.

Apex trigger

B.

validation rule

C.

After record-triggered flow

D.

Before record-triggered flow

Full Access
Question # 8

A business has a proprietary Order Management System (QMS) that creates orders from Its website and fulfills the orders. When the order Is created in the OMS, an integration also creates an order record In Salesforce and relates It to the contact as identified by the email on the order. As the order goes through different stages in the OMS, the integration also updates it in Salesforce.

The business notices that each update from the OMS creates a new order record in Salesforce.

Which two actions should prevent the duplicate order records from being created in Salesforce?

A.

Use the email on the contact record as an external ID.

B.

Use the order number from the OMS as an external ID.

C.

Write a trigger on the Order object to delete the duplicates.

D.

Ensure that the order number in the OMS is unique.

Full Access
Question # 9

An Opportunity needs to have an amount rolled up from a custom object that is not in a master-detail relationship.

How can this be achieved?

A.

Use the Streaming API to create real-time roll-up summaries.

B.

Write a trigger on the child object and use an agaregate function to sum the amount for all related child objects under the Opportunity.

C.

Use the Metadata API to create real-time roll-up summaries,

D.

Write a trigger on the Opportunity object and use tree sorting to sum the amount for all related child objects under the Opportunity.

Full Access
Question # 10

A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.

What two things should be done to create the test data within the unit test with the least amount of code?

Choose 2 answers

A.

Use Test.loadData to populate data in your test methods.

B.

Create a static resource containing test data.

C.

Use the @isTest (isParallel=true) annotation in the test class.

D.

Use the @isTest (seeAllData=true) annotation in the test class.

Full Access
Question # 11

A developer needs to have records with specific field values in order to test a new Apex class.

What should the developer do to ensure the data is available to the test?

A.

Use test.loadData() and reference a JSON file in Documents.

B.

Use Test.loadData() and reference a CSV file in a static resource.

C.

Use Anonymous Apex to create the required data.

D.

Use SOQL to query the org for the required data.

Full Access
Question # 12

A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles.

Which two tools can they use to run a script that deploys to a sandbox?

Choose 2 answers

A.

VSCode

B.

Developer Console

C.

Change Sets

D.

SFOX CLI

Full Access
Question # 13

A developer considers the following snippet of code:

Based on this code, what is the value of x?

A.

1

B.

2

C.

4

D.

3

Full Access
Question # 14

A developer has an integer variable called maxattempts. The developer needs to ensure that once maxattempts is initialized, it preserves its value for the length of

the Apex transaction; while being able to share the variable's state between trigger executions.

How should the developer declare mazattempts to meet these requirements?

A.

Declare maxattempts as a constant using the static and £inal keywords.

B.

Declare maxaztenpts as a member variable on the trigger definition.

C.

Declare maxattenpes as a variable on a helper class.

D.

Declare raxattensts as a private static variable on a helper class.

Full Access
Question # 15

What does the Lightning Component framework provide to developers?

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

Full Access
Question # 16

A developer is tasked with building a custom Lightning web component to collect Contact information.

The form will be shared among many different types of users in the org. There are security requirements that only certain fields should be edited and viewed by certain groups of users.

What should the developer use in their Lightning Web Component to support the security requirements?

A.

force-input-field

B.

lightning-input-field

C.

ui-input-field

D.

aura-input-field

Full Access
Question # 17

Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class, Con

Which is the correct definition of the Apex method that gets the additional information?

A)

B)

C)

D)

A.

Option A

B.

Option

C.

Option

D.

Option

Full Access
Question # 18

Where are two locations a developer can look to find information about the status of batch or future methods?

Choose 2 answers

A.

Developer Console

B.

Apex Flex Queue

C.

Apex Jobs

D.

Paused Flow Interviews component

Full Access
Question # 19

Refer to the following Apex code:

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

A.

0

B.

1

C.

2

D.

3

Full Access
Question # 20

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?

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.

Full Access
Question # 21

A developer must perform a complex SOQL query that joins two objects in a Lightning component.

How can the Lightning component execute the query?

A.

Create a flow to execute the query and invoke from the Lightning component.

B.

Write the query in a custom Lightning web component wrapper and invoke from the Lightning component.

C.

Invoke an Apex class with the method annotated as @AuraEnabled to perform the query.

D.

Use the Salesforce Streaming API to perform the SOQL query.

Full Access
Question # 22

Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own.

What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?

A.

Use the schema describe calls to determine if the logged-in user has access to the Account object,

B.

Use the with sharing keyword on the class declaration.

C.

Use the without sharing keyword on the class declaration.

D.

Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.

Full Access
Question # 23

Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.

Which Visualforce feature supports this requirement?

A.

Controller Extension and tag

B.

Standard Controller with Custom List Controller extension

C.

Standard controller and the recordsetzvar page attribute

D.

Custom List Controller with recordSetvar page attribute

Full Access
Question # 24

What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers"?

A)

B)

C)

D)

A.

Option

B.

Option

C.

Option

D.

Option

Full Access
Question # 25

A lead developer creates a virtual class called "OrderRequest". Consider the following code snippet:

How can a developer use the OrderRequest class within the CustomerOrder class?

A.

public class CusctomerOrder implements Order

B.

@Implements (class="OrderRequest”)

public class CusatomaxOrder

C.

Extends (class="OrderRequest”) pubklic

class CuastomerOrder

D.

public class CustomerOrder extends OrderRequest

Full Access
Question # 26

In terms of the MVC paradigm, what are two advantages of implementing the view layer of a Salesforce application using Lightning Web Component-based

development over Visualforce?

Choose 2 answers

A.

Self-contained and reusable units of an application

B.

Log capturing via the Debug Logs Setup page

C.

Rich component ecosystem

D.

Built-in standard and custom set controllers

Full Access
Question # 27

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

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 28

A company has a custom object, order__ ¢, that has a required, unique external ID field called crder_number_c.

Which statement should be used to perform the DML necessary to insert new records and update existing records in a list of order_c records using the external ID field?

A.

merge orders;

B.

merge orders Order_Number_ c;

C.

upsert orders:

D.

upserrc orders Order Number_c;

Full Access
Question # 29

developer must provide custom user interfaces when users edit a Contact either Salesforce Classic or Lightning Experience.

What should the developer use to override the Contact's Edit button and provide this functionality?

A.

A Lightning component in Salesforce Classic and a Lightning component in Lightning Experience

B.

A Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience

C.

A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience

D.

A Visualforce page in Salesforce Classic and a Lightning page In Lightning Experience

Full Access
Question # 30

A developer wants to send an outbound message when a record meets a specific criteria.

Which two features satisfy this use case?

Choose 2 answers

A.

Entitlement Process can be used to check the record criteria and send an outbound message without Apex code.

B.

Approval Process can be used to check the record criteria and send an outbound message without Apex code.

C.

Next Best Action can be used to check the record criteria and send an outbound message.

D.

Flow Builder can be used to check the record criteria and send an outbound message.

Full Access
Question # 31

As part of new feature development, a developer Is asked to build a responsive application capable of responding to touch events, that will be executed on stateful clients.

Which two technologies are built on a framework that fully supports the business requirement?

Choose 2 answers

A.

Aura Components

B.

Visualforce Pages

C.

Lightning Web Components

D.

Visualforce Components

Full Access
Question # 32

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?

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

Full Access
Question # 33

What are two characteristics related to formulas?

Choose 2 answers

A.

Formulas are calculated at runtime and are not stored in the database.

B.

Formulas can reference themselves.

C.

Formulas can reference values in related objects.

D.

Fields that are used in a formula field can be deleted or edited without editing the formula.

Full Access
Question # 34

Universal Hiring uses Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the master object, Job_Application__c acting as the detail.

Within the Job__c object, a custom multi-select picklist, Preferred Locations__c, contains a list of approved states for the position. Each Job_Application__c record relates to a Contact within the system through a master-detail relationship.

Recruiters have requested the ability to view whether the Contact's Mailing State value matches a value selected on the Preferred_Locations_ c field, within the Job_Application__c record. Recruiters would like this value to be kept in sync if changes occur to the Contact's Mailing State.

What is the recommended tool a developer should use to meet the business requirement?

A.

Roll-up summary field

B.

Record-triggered flow

C.

Formula field

D.

Apex trigger

Full Access
Question # 35

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

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.

Full Access
Question # 36

A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable.

Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?

A.

Account,iaDelecable ()

B.

accountRec.a0biectType.iaDeletable()

C.

accountRec.islCelezable()

D.

Schema.sObjectType.Account,isDeletetable() Account,isDelecable ()

Full Access
Question # 37

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:

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

Choose 2 answers

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

Full Access
Question # 38

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

A.

insert records

B.

Database.insert (records, false)

C.

Insert (records, false)

D.

Database.insert(records, true)

Full Access
Question # 39

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

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.

Full Access
Question # 40

How should a developer write unit tests for a private method in An Apex class?

A.

Add a test method in the Apex class,

B.

Use the SeeAllData annotation.

C.

Use the @TestVisible annotation.

D.

Mark the Apex class as global.

Full Access
Question # 41

A custom object Trainer_ < has a lookup field to another custom object cym__ c.

Which SOQL query will get the record for the Viridian City Gym and all it's trainers?

A.

SELECT Id; (SELECT Id FROM Trainers_r) FROM Gym_ _c WHERE Name = 'Viridian City Gym'

B.

SELECT Id, (SELECT Id FROM Trainer_c) FROM Gym__c WHERE Name = 'Viridian City Gym'

C.

SELECT ID FROM Trainer ¢ WHERE Gym__r.Name = 'Viridian City Gym'

D.

SELECT Id, (SELECT Id FROM Trainers_c) FROM Gym_c WHERE Name - 'Viridian City Gym’'

Full Access
Question # 42

When a user edits the Postal Code on an Account, a custom Account text field named "Timezoneâ„¢ must be updated based on the values in a PoataliCodeToTimezcone o custom object.

Which two automation tools can be used to implement this feature?

Choose 2 answers

A.

Quick actions

B.

Account trigger

C.

Approval process

D.

Fast Field Updates record-triggered flow

Full Access
Question # 43

A Next Best Action strategy uses an Enhance element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors.

What is the correct definition of the Apex method?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 44

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?

A.

Update a property on the parent.

B.

Fire a notification.

C.

Create a custom event,

D.

Call a method in the Apex controller.

Full Access
Question # 45

Which code displays the contents of a Visualforce page as a PDF?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 46

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

A.

Validation Rules

B.

Remote Actions

C.

Record-Triggered Flow

D.

Batch Jobs

Full Access
Question # 47

Which two statements are true about using the @testSetup annotation in an Apex test class?

Choose 2 answers

A.

a method defined with the @tetestSetup annotation executes once for each test method in the test class and counts towards system limits.

B.

Records created in the test setup method cannot be updated in individualtest methods.

C.

In a test setup method, test data is inserted once and made available for all test methods in the test class.

D.

The ©testSetup annotation is not supported when the cg5lsTest(SeeAIIData=True) annotation is used.

Full Access
Question # 48

What should a developer use to fix a Lightning web component bug in a sandbox?

A.

Execute Anonymous

B.

Developer Console

C.

Force.com IDE

D.

VS Code

Full Access
Question # 49

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

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?

A.

Controller extension

B.

Custom controller

C.

Apex trigger

D.

Validation rule

Full Access
Question # 50

An Apex method, getAccounts, that returns a list of Accounts given a searchTerm, is available for Lightning Web Components to use.

What is the correct definition of a Lightning Web Component property that uses the getAccounts method?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 51

Which code statement includes an Apex method named updateaccounts in the class accountcontreoller for use in a Lightning web component?

A.

import updatelccounts from '@aalesforce/apeax/AccountController':

B.

import updateiccounta from 'AccountConctroller':

C.

import updatelccounta from ‘RAccountContraller,updateiccounta’;

D.

import updase’Accounts from

'@=salesforce/apex/AccountController ., updateaccounts’;

Full Access
Question # 52

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?

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.

Full Access