Weekend 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 (SP25) Question and Answers

Question # 4

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.

Record-Triggered Flow

B.

Batch Jobs

C.

Remote Actions

D.

Validation Rules

Full Access
Question # 5

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

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

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 maxAttempts to meet these requirements?

A.

Declare maxattempts as a constant using the static and final keywords.

B.

Declare maxattempts as a member variable on the trigger definition.

C.

Declare maxattempts as a variable on a helper class.

D.

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

Full Access
Question # 8

A developer wants to mark each Account in a List as either Active or Inactive, based on the value in the LastModified each Account being greater than 90 days in the past.

Which Apex technique should the developer use?

A.

An if-else statement, with a for loop inside

B.

A witch statement, with a for loop inside

C.

A for loop, with an if or if/else statement inside

D.

A for loop, with a switch statement inside

Full Access
Question # 9

A Salesforce administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura component.

Which tag should a developer use to display the flow in the component?

A.

lightning: flow

B.

lightning-low

C.

sure-flow

D.

aura: flow

Full Access
Question # 10

What is the result of the following code snippet?

public word doWork(Account acct) {

for (Integer i = 0; i <= 2007 i++) {

insert acct;

}

A.

Accounts are inserted.

B.

Account is inserted.

C.

200 Accounts are inserted.

D.

201 Accounts are inserted.

Full Access
Question # 11

A company has a custom object, order __c, that has a required, unique external ID field called order 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 Order Number c;

D.

upsert orders;

Full Access
Question # 12

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

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

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 another custom object called PostalCodeToTimezone__c.

What is the optimal way to implement this feature?

A.

Build a flow with Flow Builder.

B.

Create an account approval process.

C.

Create a formula field.

D.

Build an account assignment rule.

Full Access
Question # 15

Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience.

What should the developer do to fulfill the business request in the quickest and most effective manner?

A.

Rewrite all Visualforce pages as Lightning components.

B.

Set the attribute enableLightning to true in the definition.

C.

Enable Available for Lightning Experience, Lightning Communities, and the mobile app on Visualforce pages used by the custom application.

D.

Incorporate the Salesforce Lightning Design System CSS stylesheet Into the JavaScript applications.

Full Access
Question # 16

(Full question statement)

Universal Containers recently transitioned fromClassic to Lightning Experience. One of its business processes requirescertain values from the Opportunity objectto be sent via anHTTP REST calloutto itsexternal order management systemwhen the user presses a custom button on the Opportunity detail page.

Example fields:

Name

Amount

Account

Which two methods should the developer implement to fulfill the business requirement?

Choose 2 answers.

A.

Create a customVisualforce quick actionthat performs the HTTP REST callout and use it on the Opportunity detail page.

B.

Create anafter update triggeron the Opportunity object that calls a helper method using @future(callout=true) to perform the HTTP REST callout.

C.

Create aLightning component quick actionthat performs the HTTP REST callout and use it on the Opportunity detail page.

D.

Create aRemote Actionon the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated.

Full Access
Question # 17

A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.

Which two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?

Choose 2 answers

A.

Use a Test Date Factory class.

B.

Use the @TsTest (SeeAllData=true) annotation.

C.

Use the Test. leadteat{) method.

D.

Use without sharing on the class declaration.

Full Access
Question # 18

Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order records will be imported into Salesforce.

How should the Order Number field be defined in Salesforce?

A.

Indirect Lockup

B.

Direct Lookup

C.

External ID and Unique

D.

Lookup

Full Access
Question # 19

The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists across different objects.

What is an approach a developer can take to streamline maintenance of the picklists and their values, while also restricting the values to the ones mentioned above?

A.

Create the Picklist on each object and use a Global Picklist Value Set containing the values.

B.

Create the Picklist on each object as a required field and select "Display values alphabetically, not in the order entered".

C.

Create the Picklist on each object and add a validation rule to ensure data integrity.

D.

Create the Picklist on each object and select "Restrict picklist to the values defined in the value set".

Full Access
Question # 20

A developer created a Lightning web component called statuscomponent to be Inserted into the Account record page.

Which two things should the developer do to make this component available?

Choose 2 answers

A.

Add lightning_Recordpage to the statuscomponent. js file,

B.

Add lightning RecordPage to the statusComp .js-meta.xml file.

C.

Set is Exposes to true In the statuscomponent.js-meta.xml file.

D.

Add Account to the statusComponent. js-meta.xm1 file.

Full Access
Question # 21

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

A.

Lightning action

B.

Lightning page

C.

Lightning component

D.

Lightning flow

Full Access
Question # 22

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

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?

A.

Lightning Data Service ignores field-level security.

B.

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

C.

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

D.

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

Full Access
Question # 23

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 inSalesforce 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 # 24

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

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 with sharing keyword on the class declaration.

B.

Use the without sharing keyword on the class declaration.

C.

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

D.

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

Full Access
Question # 26

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.

Trigger execution order cannot be guaranteed.

C.

Triggers are executed alphabetically by trigger name.

D.

Triggers are executed in the order they are created.

Full Access
Question # 27

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

(Full question statement)

A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class.

public virtual class Payment {

public virtual void makePayment(Decimal amount) {

// implementation

}

}

Which is the correct implementation?

A.

public class CreditCardPayment extends Payment { public virtual void makePayment(Decimal amount) { /* implementation */ } }

B.

public class CreditCardPayment implements Payment { public virtual void makePayment(Decimal amount) { /* implementation */ } }

C.

public class CreditCardPayment implements Payment { public override void makePayment(Decimal amount) { /* implementation */ } }

D.

public class CreditCardPayment extends Payment { public override void makePayment(Decimal amount) { /* implementation */ } }

Full Access
Question # 29

A custom picklist field, Pool Preference ¢, exists on a custom object. The picklist contains the following options: ‘Vegan’, ‘Kosher’, 'No Preference’. The developer must ensure a value is populated every time a record is created or updated.

What is the optimal way to ensure a value is selected every time a record is saved?

A.

Set "Use the first value in the list as the default value" to True.

B.

Write an Apex trigger to ensure a value is selected,

C.

Mark the field as Required on the object's page layout.

D.

Mark the field as Required on the field definition.

Full Access
Question # 30

Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine-tuned and provides a seamless user experience.

What are some benefits of using the Lightning Component framework?

A.

Better performance due to client-side rendering

B.

Automatic support for accessibility standards

C.

Compatibility with all web browsers

D.

Easy integration with third-party libraries

Full Access
Question # 31

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.

Rich component ecosystem

B.

Leg capturing via the Debug Logs Setup page

C.

Built-in standard and custom set controllers

D.

Self-contained and reusable units of an application

Full Access
Question # 32

A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what is defined for payments in the PaymentProcessor interface.

apex

Copy

public interface PaymentProcessor {

void pay(Decimal amount);

}

Which is the correct implementation to use the PaymentProcessor interface class?

A.

apex

Copy

public class CheckPaymentProcessor implements PaymentProcessor {

public void pay(Decimal amount) {}

}

B.

apex

Copy

public class CheckPaymentProcessor implements PaymentProcessor {

public void pay(Decimal amount);

}

C.

apex

Copy

public class CheckPaymentProcessor extends PaymentProcessor {

public void pay(Decimal amount);

}

D.

apex

Copy

public class CheckPaymentProcessor extends PaymentProcessor {

public void pay(Decimal amount) {}

}

Full Access
Question # 33

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

What are three characteristics of change set deployments?

Choose 3 answers Sending a change set between two orgs requires a deployment connection.

A.

Change sets can deploy custom settings data.

B.

Change sets can only be used between related organizations.

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 be used to transfer records.

Full Access
Question # 35

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

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

Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

A.

fire()

B.

SegdetesEvent (}

C.

FireEvent()

D.

emit()

Full Access
Question # 38

A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an

OrderlItem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.

What should a developer do to allow their code to move some existing OrderItem records to a new Order record?

A.

Add without sharing to the Apex class declaration.

B.

Change the master-detail relationship to an external lookup relationship.

C.

Create a junction object between OrderItem and Order.

D.

Select the Allow reprinting option on the master-detail relationship.

Full Access
Question # 39

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

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.

apex

Copy

webservice class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

global static String updateRecords() { /* implementation ... */ }

}

B.

apex

Copy

global class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

webservice static String updateRecords() { /* implementation ... */ }

}

C.

apex

Copy

webservice class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

webservice static String updateRecords() { /* implementation ... */ }

}

D.

apex

Copy

global class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

global String updateRecords() { /* implementation ... */ }

}

Full Access
Question # 41

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.

aura-input-failed

B.

force-input-failed

C.

ui-input-failed

D.

lightning-input-failed

Full Access
Question # 42

Assuming that name is a String obtained by a Visualforce page, which two SOQL queries performed are safe from SOQL injection? (Choose two.)

A.

apex

Copy

String query = '%' + name + '%';

List results = [SELECT Id FROM Account WHERE Name LIKE :query];

B.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name.noQuotes() + '%\'';

List results = Database.query(query);

C.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + String.escapeSingleQuotes(name) + '%\'';

List results = Database.query(query);

D.

apex

Copy

String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name + '%\'';

List results = Database.query(query);

Full Access
Question # 43

(Full question statement)

A developer is tasked with building a custom Lightning Web Component (LWC) to collectContactinformation. The form will be shared among different types of users in the org. There are security requirements stating that only certain fields should beeditable and visibleto certain groups of users.

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

A.

lightning-input-field

B.

force:inputField

C.

aura:input

D.

ui:inputField

Full Access
Question # 44

Provide question feedback here (optional):

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

A.

4

B.

1

C.

2

D.

3

Full Access
Question # 45

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

A.

By providing device-awareness for mobile and desktops

B.

By providing an Agile process with default steps

C.

By providing change history and version control

D.

By providing code review standards and processes

Full Access
Question # 46

Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightning web component?

Choose 3 answers

A.

Import the static resource and provide a JavaScript property for it.

B.

Upload the SVG as a static resource.

C.

Reference the import in the HTML template.

D.

Import the SVG as a content asset file.

E.

Reference the property in the HTML template.

Full Access
Question # 47

Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.

Based on some internal discussions, the UC administrator tried to change the master-detail relationship to a lookup relationship, but was not able to do so.

What is a possible reason that this change was not permitted?

A.

Some of the Vendor records have null for the Account field.

B.

The Account object has a roll up summary field on the Vendor object.

C.

The Account object does not allow changing a field type for a custom field.

D.

The organization wide default for the Vendor object is Public Read/Write.

Full Access
Question # 48

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.

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

B.

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

C.

Use the Salesforce Streaming APL to perform the SOQL query.

D.

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

Full Access
Question # 49

A developer is designing a new application on the Salesforce platform and wants to ensure it can support multiple tenants effectively.

Which design framework should the developer consider to ensure scalability and maintainability?

A.

Waterfall Model

B.

Flux (view, action, dispatcher, and store)

C.

Model-View-Controller (MVC)

D.

Agile Development

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.

@wire(getAccounts, { searchTerm: '$searchTerm' })

B.

@track(getAccounts, '$searchTerm')

C.

@wire(getAccounts, 'searchTerm: $searchTerm')

D.

@wire(getAccounts, '$searchTerm')

Full Access
Question # 51

The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records:

Which governor limit will likely be exceeded within the Apex transaction?

A.

Total number of SOOL quires issued

B.

Total number of DML statements issued

C.

Total number of records processed as a result of DML statements

Full Access
Question # 52

A developer considers the following snippet of code:

Boolean isOK;

Integer x;

String theString = 'Hello';

if (isOK == false && theString == 'Hello') {

x = 1;

} else if (isOK == true && theString == 'Hello') {

x = 2;

} else if (isOK == null && theString == 'Hello') {

x = 3;

} else {

x = 4;

}

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

A.

1

B.

2

C.

3

D.

4

Full Access
Question # 53

While writing an Apex class, a developer wants to make sure that all functionality being developed is handled as specified by the requirements.

Which approach should the developer use to be sure that the Apex class is working according to specifications?

A.

Include a savepoint and pacabase.rollback().

B.

Include a try/catch block to the Apex class.

C.

Run the code in an Execute Anonymous block in the Developer Console.

D.

Create a test class to execute the business logic and run the test in the Developer Console.

Full Access
Question # 54

Given the following Anonymous block:

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

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

A.

The transaction will succeed and changes will be committed.

B.

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

C.

The transaction will fail due to exceeding the governor limit.

D.

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

Full Access
Question # 55

What is an example of a polymorphic lookup field in Salesforce?

A.

The Parentid field on the standard Account object

B.

A custom field, Link__c, on the standard Contact object that looks up to an Account or a Campaign

C.

The Whatld field on the standard Event object

D.

The LeadId and Contactid fields on the standard Campaign Member object

Full Access
Question # 56

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.

apex

Copy

@InvocableMethod

global static List> getLevel(List input)

{ /*implementation*/ }

B.

apex

Copy

@InvocableMethod

global Recommendation getLevel(ContactWrapper input)

{ /*implementation*/ }

C.

apex

Copy

@InvocableMethod

global List> getLevel(List input)

{ /*implementation*/ }

D.

apex

Copy

@InvocableMethod

global static List getLevel(List input)

{ /*implementation*/ }

Full Access
Question # 57

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

A.

B.

C.

D.

Full Access
Question # 58

What can be easily developed using the Lightning Component framework?

A.

Salesforce Classic user interface pages

B.

Lightning Pages

C.

Customized JavaScript buttons

D.

Salesforce integrations

Full Access
Question # 59

When the code executes, a DML exception is thrown.

How should a developer modify the code to ensure exceptions are handled gracefully?

A.

Implement the upset DML statement.

B.

Implement Change Data Capture.

C.

Implement a try/catch block for the DML.

D.

Remove null items from the list of Accounts.

Full Access
Question # 60

(Full question statement)

Universal Containers wants Opportunities to no longer be editable when they reach the Closed/Wonstage.

Which two strategies can a developer use to accomplish this?

Choose 2 answers.

A.

Use an automatically launched Approval Process.

B.

Use a Validation Rule.

C.

Use a before-save Apex Trigger.

D.

Use an Auto-Response Rule.

Full Access