New Year Special Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > Salesforce > Developers > PDI

PDI Salesforce Certified Platform Developer 1 (WI25) Question and Answers

Question # 4

A 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?

A.

Developer sandboxes.

B.

Full Copy sandboxes

C.

Developer orgs

D.

Scratch orgs

Full Access
Question # 5

A developer considers the following snippet of code:

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

A.

1

B.

2

C.

3

D.

4

Full Access
Question # 6

Universal Containers decided to transition from Classic to Lightning Experience. They asked a developer to replace a JavaScript button that was being used to create records with prepopulated values.

What can the developer use to accomplish this?

A.

Validation rules

B.

Apex triggers

C.

Record triggered flows

D.

Quick Actions

Full Access
Question # 7

Universal Containers hires a developer to build a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field.

Which consideration should the developer be aware of when deciding between SOQL and SOSL?

Choose 2 answers

A.

SOSL is faster for text searches.

B.

SOQL is able to return more records

C.

SOQL Is faster for text searches.

D.

SOSL is able to return more records.

Full Access
Question # 8

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

Upload the CSV into-a custom object related to candidate__c.

B.

Create a before insert trigger to correctly map the records,

C.

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

D.

Create a before save flow to correctly map the records.

Full Access
Question # 9

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

Choose 2 answers

A.

Tooling API

B.

Metadata API

C.

Bulk API

D.

Developer Console

Full Access
Question # 10

Which three resources in an Aura component can contain JavaScript functions?

Choose 3 answers

A.

Style

B.

Renderer

C.

Controller

D.

Design

E.

Helper

Full Access
Question # 11

Which two actions may cause triggers to fire?

Choose 2 answers

A.

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

B.

Updates to FeedItem

C.

Cascading delete operations

D.

Renaming or replacing a picklist entry

Full Access
Question # 12

What are two benefits of using declarative customizations over code?

Choose 2 answer

A.

Declarative customizations automatically update with each Salesforce release.

B.

Declarative customizations automatically generate test classes.

C.

Declarative customizations cannot generate run time errors

D.

Declarative customizations generally require less maintenance

Full Access
Question # 13

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?

A.

Use a trigger on the Case object.

B.

Use a formula field on the Case object.

C.

Use a validation rule on the Case object.

D.

Use an Assignment Flow element.

Full Access
Question # 14

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

Choose 3 answers

A.

Static resources

B.

All external libraries

C.

SVG resources

D.

Third-party web components

E.

Content asset files

Full Access
Question # 15

A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c.

As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company should be able to report multiple bugs and bugs can also be reported by multiple companies.

What is needed to allow this reporting?

A.

Roll-up summary field of Bug_c on Account

B.

Master-detail field on Bug_c to Account

C.

Lookup field on Bug_c to Account

D.

Function object between Bug__c and Account

Full Access
Question # 16

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

A.

Developer Console

B.

Force.com IDE

C.

Execute Anonymous

D.

VS Code

Full Access
Question # 17

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

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?

A.

Formula field

B.

Record-triggered flow

C.

Roll-up summary field

D.

Apex trigger

Full Access
Question # 18

A developer has the following requirements:

• Calculate the total amount on an Order.

• Calculate the line amount for each Line Item based on quantity selected and price.

• Move Line Items to a different Order if a Line Item is not in stock.

Which relationship implementation supports these requirements on its own?

A.

Line Item has a re-parentable master-detail field to Order.

B.

Line Item has a re-parentable lookup field to Order.

C.

Order has a re-parentable lookup field to Line Item.

D.

Order has are-parentable master-detail field to Line Item.

Full Access
Question # 19

Developers at Universal Containers (UC) use version control to share their code changes, but they notice that when they deploy their code to different environments they often have failures. They decide to set up Continuous Integration (CI).

What should the UC development team use to automatically run tests as part of their CI process?

A.

Salesforce CLI

B.

Visual Studio Code

C.

Force.com Toolkit

D.

Developer Console

Full Access
Question # 20

A lead developer creates an Apex interface called Laptop. Consider the following code snippet:

public class SilverLaptop{

//code implementation

How can a developer use the Laptop interface within the silverLaptop class?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 21

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?

A.

Setup Menu

B.

Visual Studio Code IDE

C.

AppExchange

D.

Developer Console

Full Access
Question # 22

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.

Standard Controller with Custom List Controller extension

B.

Custom List Controller with recorasetvar page attribute

C.

Controller Extension and tag

D.

Standard controller and the recordsetvar page attribute

Full Access
Question # 23

How can a developer check the test coverage of autolaunched Flows before deploying them in a change set?

A.

Use the ApextestResult class.

B.

Use the Flow Properties page.

C.

Use SOQL and the Tooling API.

D.

Use the Code Coverage Setup page,

Full Access
Question # 24

How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?

A.

apex:page standardController="Notice_c" extensions="myControllerExtension"”

B.

apex:page controllers="Notice_c, myContcollerExtension"

C.

apex:pege=Notice extends="myControllerExtension”

D.

apex:page controller="Notice_c" extensions="myControllerExtension"

Full Access
Question # 25

A software company uses the following objects and relationships:

* Case: to handle customer support issues

* Defect__c: a custom object to represent known issues with the company's software

* Case Defect__c a junction object between Case and Defect __c to represent that a defect is a cause of a customer issue

Case and Defect__c have Private organization-wide defaults.

What should be done to share a specific Case_Defect__c record with a user?

A.

Share the parent Cast record Defect_c records.

B.

Share the parent Case and record_c record.

C.

Share the parent Defect__c record.

D.

Share the case_Defect_c record.

Full Access
Question # 26

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?

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 27

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

A.

import updateAccounts from "AccountControlles';

B.

import updateAccounts from "Salesforce/apex/AccountController:';

C.

import updateAccounts from "Account@ontroller.updateAccounts';

D.

import updateAccounts from "@salesforce/apex/AccountController.updateAccounts";

Full Access
Question # 28

Which exception type cannot be caught?

A.

custom exception

B.

LinkException

C.

NoAccessException

D.

CelloutException

Full Access
Question # 29

While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accessible to the currently logged in user are displayed?

A.

Use the WITH SECURITY_ENFORCED clause within the SOQL.

B.

Use the inherited sharing keyword.

C.

Use the with sharing keyword.

D.

Use the without sharing keyword.

Full Access
Question # 30

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)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 31

Which annotation exposes an Apex class as a RESTful web service?

A.

@RemoteAction

B.

@RestResource (urlMapping='/myService/*"')

C.

@HttpInvocable

D.

@Aurabnabled(cacheable=true)

Full Access
Question # 32

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.

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

B.

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

C.

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

D.

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

Full Access
Question # 33

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

Choose 2 answers

A.

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

B.

Data import wizard is an application that is installed on your computer

C.

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

D.

Developer and Developer Pro sandboxes have different storage limits.

Full Access
Question # 34

A company's engineering department is conducting a month-long test on the scalability of an in-house-developed software that requires a cluster of 100 or more servers. Which of the following models is the best to use?

A.

PaaS

B.

SaaS

C.

BaaS

D.

laaS

Full Access
Question # 35

What should be used to create scratch orgs?

A.

Salesforce CLI

B.

Sandbox refresh

C.

Developer Console

D.

Workbench

Full Access
Question # 36

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:

ist performSearch (String lastName} [

return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like

s'+lastName+'s'")?;

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

Choose 2 answers

A.

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

B.

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

C.

Use the ¢Readonly annotation and the with sharing keyword on the class.

D.

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

Full Access
Question # 37

A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class.

Which code segment shows the correct declaration of the class and methods?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 38

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

Choose 2 answers

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 39

A business has a proprietary Order Management System (OMS) 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?

Choose 2 answers

A.

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

B.

Ensure that the order number in the OMS is unique.

C.

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

D.

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

Full Access
Question # 40

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 # 41

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.

accountRec, isDeletable()

B.

Schema,sObjectType,Account, isDeletable ()

C.

accuntRec, sObjectType,isDeletable()

D.

Account,isDeleteable

Full Access
Question # 42

Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class, ContactInfo. Which is the correct definition of the Apex method that gets the additional information?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 43

When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?

A.

Sandbox

B.

Environment Hub

C.

Production

D.

Dev Hub

Full Access
Question # 44

The Job _Application__c custom object has a field that is a master-detail relationship to the Contact object, where the Contact object is the master.

As part of a feature implementation, a developer needs to retrieve a list containing all Contact records where the related Account Industry is

‘Technology’, while also retrieving the Contact's Job_Application__c records.

Based on the object's relationships, what is the most efficient statement to retrieve the list of Contacts?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 45

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.

SFDX CLI

B.

Developer Console

C.

Change Sets

D.

Ant Migration Tool

Full Access
Question # 46

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.

Lightning Web Components

B.

Visualforce Components

C.

Visualforce Pages

D.

Aura Components

Full Access
Question # 47

Given the following Apex statement:

Account myAccount = [SELECT Id, Name FROM Account);

What occurs when more than one Account is returned by the SOQL query?

A.

The variable, myaccount, is automatically cast to the List data type.

B.

An unhandled exception is thrown and the code terminates.

C.

The query fails and an error is written to the debug log.

D.

The first Account returned is assigned to myAccount.

Full Access
Question # 48

Universal Containers is building a recruiting app with an Applicant object that stores information about an individual person and a Job

object that represents a job. Each applicant may apply for more than one job.

What should a developer implement to represent that an applicant has applied for a job?

A.

Junction object between Applicant and Job

B.

Lookup field from Applicant to Job

C.

Master-detail field from Applicant to Job

D.

Formula field on Applicant that references Job

Full Access
Question # 49

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 Jobs

C.

Paused Flow Interviews component

D.

Apex Flex Queue

Full Access
Question # 50

Refer to the component code 9f\d requirements below:

Requirements

* For mobile devices. the information should display in three rows.

* For desktops and tablets, the information should display in a single row.

Requirement 2 is not displaying as desired.

Which option has the correct component code to meet the requirements for desktops end and tablets?

A)

B)

C)

A.

Option A

B.

Option B

C.

Option C

Full Access
Question # 51

A developer identifies the following triggers on the Expense _c object:

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

A.

Unity all three triggers In a single trigger on the Expense__c object that Includes all events.

B.

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

C.

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

D.

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

Full Access
Question # 52

What is the result of the following code?

A.

The record will not be created and an exception will be thrown.

B.

The record will not be created and no error will be reported.

C.

The record will be created and no error will be reported.

D.

The record will be created and a message will be in the debug log.

Full Access
Question # 53

A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message ‘Maximum trigger depth exceeded’.

What could be the possible causes?

A.

The developer does not have the correct user permission.

B.

The trigger is too long and should be refactored into a helper class.

C.

The trigger does not have sufficient code coverage.

D.

The trigger is getting executed multiple times.

Full Access
Question # 54

A developer needs to allow users to complete a form on an Account record that will create a record for a custom object.

The form needs to display different fields depending on the user’s job role, The functionality should only be available to a small group of users.

Which three things should the developer do to satisfy these requirements?

Choose 3 answers

A.

Create a Dynamic Form.

B.

Create a Custom Permission for the users.

C.

Add a Dynamic Action to the Users’ assigned Page Layouts.

D.

Create a Lightning wed component.

E.

Add a Dynamic Action to the Account Record Page.

Full Access
Question # 55

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

Which method allows access to the price book?

A.

Use Test .getStandardPricebookid() to get the standard price book ID.

B.

Use @isTest [SeeAllData=true| and delete the existing standard price book.

C.

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

D.

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

Full Access
Question # 56

A developer is working on a project to import data from an external system into Salesforce. The data contains sensitive information that should not be visible to all users in Salesforce.

What should the developer do to ensure that the data is secure?

A.

Use a third-party tool to encrypt the sensitive data before importing it into Salesforce.

B.

Use the Apex Data Loader to import the into and write Apex code to handle security and access

control.

C.

Use the Data Import Wizard to import the data arid set up field-level security to restrict access to

sensitive fields.

D.

Use the Salesforce CLI to import the data and set up user permissions to restrict access to sensitive data.

Full Access
Question # 57

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?

A.

Lookup field from Opportunity to Engineering _support__c

B.

Master-detail field from Engineering Support__c to Opportunity

C.

Master-detail field from Opportunity to Engineering Support__c

D.

Lookup field from Engineering Support __c to Opportunity

Full Access
Question # 58

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

The developer creates a test class with a test method that calls MyClass.myStaticMethod 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?

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 59

A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner.

What is the most efficient way for a developer to implement this?

A.

Apex trigger on Task

B.

Task actions

C.

Auto-launched flow on Task

D.

Record-triggered flow on Opportunity

Full Access
Question # 60

A developer writes a trigger on the Account object on the before update event that increments a count field. A record triggered flow also increments the count field every time that an Account is created or updated.

What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

A.

4

B.

2

C.

1

D.

3

Full Access