Valid PDI Dumps shared by ExamDiscuss.com for Helping Passing PDI Exam! ExamDiscuss.com now offer the newest PDI exam dumps, the ExamDiscuss.com PDI exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDI dumps with Test Engine here:

Access PDI Dumps Premium Version
(187 Q&As Dumps, 35%OFF Special Discount Code: freecram)

Online Access Free PDI Exam Questions

Exam Code:PDI
Exam Name:Platform Developer I (PDI)
Certification Provider:Salesforce
Free Question Number:96
Version:v2025-12-04
Rating:
# of views:4292
# of Questions views:118524
Go To PDI Questions

Recent Comments (The most recent comments are at the top.)

Yassine - Oct 20, 2026

No.# Answer: D. JavaScript validation is run in the browser.

The mention of dependent picklists is the clue. Salesforce’s order of execution starts before any server-side step: if the record contains dependent picklist fields, the browser runs JavaScript validation first. That validation restricts each dependent picklist to its available values, and no other JavaScript validation happens. Only after that does the save request reach the server.

The server-side steps then run in this order:

The original record is loaded from the database (or initialized for an upsert).
The new field values from the request overwrite the old values, and system validation runs when the request came from the standard UI. This validation includes maximum field lengths.
Before triggers, then the remaining validation, duplicate rules, the save, after triggers, and so on.

So the other options come later:

A: Loading the original record is the first server-side step, but it runs after the browser’s JavaScript validation.
B and C: These belong to the second server-side step, when the new values are applied and system validation runs...

Yassine - Oct 20, 2026

No.# code is not showing

Yassine - Oct 20, 2026

No.# Answer: C. upsert orders Order_Number__c;

upsert inserts new records and updates existing ones in a single statement. To match on the external ID instead of the Salesforce Id, you name the external ID field after the list:

apex
upsert orders Order__c.Order_Number__c;

In Apex, the field has to be written as a field token, Order__c.Order_Number__c. Your option shows the shorthand Order Number c, which is OCR noise for the field name.

The other options don’t fit:

A and B. merge: It combines up to three duplicate records of the same object into one, which isn’t what the question asks. It also doesn’t accept a field name like that.
D. upsert orders;: Without an external ID field, it matches on the Salesforce Id. Records without an Id are inserted as new, so existing orders would be duplicated instead of updated.

Yassine - Oct 20, 2026

No.# Code not showing

Yassine - Oct 20, 2026

No.# Answer: B, D and E (Custom Permission, Lightning web component and Dynamic Action on the Account Record Page)

This is the same question you asked earlier with the options reordered, and my answer is unchanged.

D. Lightning web component: The form creates a record on a custom object and shows different fields depending on the user’s job role. That needs custom UI logic. An LWC can use lightning-record-edit-form and show or hide fields based on the user’s role or a permission check.
E. Dynamic Action on the Account Record Page: A Dynamic Action in Lightning App Builder can launch the component, for example as a quick action that opens a modal. Dynamic Actions have visibility rules, so the action can be restricted.
B. Custom Permission for the users: Assign it to the small group, then use it in the Dynamic Action’s visibility filter. The component can also check it through @salesforce/customPermission/....

The other options don’t fit:

A. Dynamic Form: Dynamic Forms control how the fields of the Account record itself appear on its page, with visibility rules. They can’t build a form that creates a record on a different custom object.
C. Dynamic Action on page layouts: Dynamic Actions are configured in Lightning App Builder on the record page, not on page layouts. Layouts apply by profile, which is a poor fit for a small group of users....

Yassine - Oct 20, 2026

No.# Answer: B. 0

The watermark covers part of the loop condition. I’m reading it as i < 500, which is the standard version of this question and fits the options.

Each pass of the loop runs its own insert a;, which is one DML statement. Apex allows only 150 DML statements per transaction. On the 151st insert, Salesforce throws a System.LimitException: Too many DML statements: 151. A limit exception can’t be caught, and the whole transaction is rolled back, so the 150 Accounts inserted before it are undone. No Accounts are saved.

The other options are wrong:

150: That is how many inserts succeed before the limit is hit, but they are rolled back.
100 and 500: Neither matches what the code does. 500 would only be possible if the inserts were bulkified.

The fix is to collect the records in a list and insert once, outside the loop:

apex
List<Account> accts = new List<Account>();
for (Integer i = 0; i < 500; i++) {
accts.add(new Account(Name = 'New Account ' + i));
}
insert accts; // one DML statement, 500 rows (under the 10,000-row limit)...

Yassine - Oct 20, 2026

No.# Answer: A and B

Both can run before the delete happens and block it. A before-delete record-triggered flow can check the Status and, if it isn’t “Decommissioned”, stop the delete with a Custom Error element. An Apex trigger can do the same in a before delete trigger.

apex
trigger ContainerTrigger on Container__c (before delete) {
for (Container__c c : Trigger.old) {
if (c.Status__c != 'Decommissioned') {
c.addError('Only decommissioned containers can be deleted.');
}
}
}

The other options don’t fit:

C. After record-triggered flow: It runs after the save step, when the delete has already been performed, so it isn’t the tool for preventing a delete. The “before” version is the expected answer.
D. Validation rule: Validation rules fire on insert and update only. They never run on delete, so they can’t block one.

Before-delete flows are a newer capability. In older material, the answer would be a trigger and one other option, but with current Flow support A is the declarative choice....

Yassine - Oct 20, 2026

No.# Code missing

Yassine - Oct 20, 2026

No.# Answer: share both parent records, Case and Defect__c.

This is the same question you asked earlier. Your options are garbled by OCR, so I can’t be sure which letter is which:

B reads “Share the parent Case and ... record”, so it is most likely the “both parents” option.
A is garbled (“Cast record Defect_c records”). It could also be a version of “both”, so please check the original wording.
C (Defect__c only) and D (the junction record itself) are clearly the wrong ones.

Case_Defect__c is a junction object with two master-detail relationships, one to Case and one to Defect__c. A detail record has no sharing settings of its own and inherits access from its parents. With two masters, and Private organization-wide defaults on both, the user needs access to both parents to see the junction record. Sharing only one of them isn’t enough.

The other options don’t fit:

Share the Case_Defect__c record (D): You can’t share a junction record directly. It has no owner and no sharing of its own.
Share only the Case (A or B, if either is single-parent) or only the Defect__c (C): The user would still lack access to the other parent....

Yassine - Oct 20, 2026

No.# Answer: C. A for loop, with an if or if/else statement inside

The code has to visit each Account in the list, so the loop is the outer structure. For each Account, an if/else compares the last-modified date to 90 days ago and sets the status.

apex
Datetime cutoff = Datetime.now().addDays(-90);

for (Account a : accounts) {
if (a.LastModifiedDate < cutoff) {
a.Status__c = 'Inactive';
} else {
a.Status__c = 'Active';
}
}

The other options don’t fit:

A. A for loop with a switch inside: switch in Apex matches a variable against specific values, such as an Integer, String, enum or sObject type. It can’t test a range like “older than 90 days”.
B. An if-else with a for loop inside: The condition has to be checked per record, so it must be inside the loop. Put outside, it would test one condition for the whole list.
D. A switch with a for loop inside: It has the same placement problem as B and can’t evaluate a date comparison.

Yassine - Oct 20, 2026

No.# No test class

Yassine - Oct 20, 2026

No.# Answer: the third implementation (option C)

It declares implements PaymentProcessor and gives pay(Decimal amount) a real body, as in the example below:

apex
public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount) {
// functional code here
}
}

PaymentProcessor is an interface, so a class uses it with implements. The class then has to provide a public or global implementation, with a body, of every method the interface declares.

The other images don’t fit:

First: It uses implements, but pay ends in a semicolon with no body. That declares the method without implementing it, so it won’t compile.
Fourth: It uses extends, which is for inheriting from a virtual or abstract class and not for applying an interface. It also has no method body.
Second: The Salesforce logo watermark covers the keyword in the class declaration, so I can’t read it. Since the third image is the clearly valid one, this one most likely has extends, which is wrong for an interface. If it did say implements, it would be identical to the third....

Yassine - Oct 20, 2026

No.# Answer: B, the second line: <apex:outputText escape="false" value="{!$CurrentPage.parameters.userInput}" />

I’m assuming the options A to D follow the four lines in the order shown in your screenshot.

This line is vulnerable to cross-site scripting (XSS). escape="false" turns off HTML encoding, and the value comes straight from a URL parameter that the user controls. An attacker can craft a link such as ?userInput=<script>...</script>, and the script would run in the victim’s browser.

The other lines are safe:

A: outputText HTML-encodes its value by default (escape="true"), so any script in the parameter is displayed as text and not executed.
C and D: outputField renders the value according to its field type and also encodes it. The rendered attribute in D only controls whether the component appears.

How to fix it:

Leave escape at its default of true unless you really need raw HTML.
If you do need to output markup, sanitize the input in the controller first, or use JSENCODE, HTMLENCODE or URLENCODE as appropriate for where the value is placed....

Yassine - Oct 20, 2026

No.# Answer: D. An invocable method

A screen flow can call Apex through an Apex action, which runs a method annotated with @InvocableMethod. The method makes the callout to the external order management system in real time and returns the order numbers and dates. The flow then shows them on a screen, for example in a data table or a choice list.

apex
public class GetExternalOrders {
public class Request { @InvocableVariable public String customerId; }
public class OrderInfo {
@InvocableVariable public String orderNumber;
@InvocableVariable public Date orderDate;
}

@InvocableMethod(label='Get external orders' callout=true)
public static List<List<OrderInfo>> getOrders(List<Request> requests) {
// HTTP callout to the order system, then build and return the results
}
}

The callout=true setting is needed so the flow can make the callout.

The other options don’t fit:

A. Outbound message: It pushes data from Salesforce to an external system when a workflow rule fires. It can’t retrieve data on demand.
B. Apex REST class: It exposes Salesforce as a web service that external systems call into. It is for inbound requests, not for calling out to another system.
C. Apex controller: It backs Visualforce pages and Lightning components. A flow can’t call it directly, and only methods exposed as invocable actions are available in Flow....

Yassine - Oct 20, 2026

No.# Answer: D. An invocable method

A screen flow can call Apex through an Apex action, which runs a method annotated with @InvocableMethod. The method makes the callout to the external order management system in real time and returns the order numbers and dates. The flow then shows them on a screen, for example in a data table or a choice list.

apex
public class GetExternalOrders {
public class Request { @InvocableVariable public String customerId; }
public class OrderInfo {
@InvocableVariable public String orderNumber;
@InvocableVariable public Date orderDate;
}

@InvocableMethod(label='Get external orders' callout=true)
public static List<List<OrderInfo>> getOrders(List<Request> requests) {
// HTTP callout to the order system, then build and return the results
}
}

The callout=true setting is needed so the flow can make the callout.

The other options don’t fit:

A. Outbound message: It pushes data from Salesforce to an external system when a workflow rule fires. It can’t retrieve data on demand.
B. Apex REST class: It exposes Salesforce as a web service that external systems call into. It is for inbound requests, not for calling out to another system.
C. Apex controller: It backs Visualforce pages and Lightning components. A flow can’t call it directly, and only methods exposed as invocable actions are available in Flow....

Yassine - Oct 20, 2026

No.# Answer: A, B and C

Your question says “three” in the title but “Choose 2” at the end. Three options are required, so I’m going with the “three” wording. The options have OCR typos, and I’m reading them as follows:

A. <apex:includeLightning/>: This loads the Lightning Components for Visualforce JavaScript library (lightning.out.js), which has to be on the page first.
C. $Lightning.use: This points to the Aura application that declares your component’s dependencies (an app that extends ltng:outApp) and runs a callback once it’s ready.
B. $Lightning.createComponent: This creates the component and inserts it into a DOM element on the page. It is called inside the $Lightning.use callback.
xml
<apex:page>
<apex:includeLightning/>
<div id="lightningContainer"></div>
<script>
$Lightning.use("c:myApp", function() {
$Lightning.createComponent("c:myComponent",
{ label: "Hello" },
"lightningContainer",
function(cmp) { /* component created */ }
);
});
</script>
</apex:page>

The other options don’t fit:

D. <apex:slds/>: This loads the Lightning Design System styles. It’s useful for styling, but it isn’t needed to create the component.
E. $Lightning.useComponent: This isn’t a real API. You may be thinking of $Lightning.use....

Yassine - Oct 20, 2026

No.# Answer: B and D

B. Data goes in the detail property: When you create a custom event, you pass the payload through the detail property, and the handler reads it with event.detail.
D. Propagation is limited by default: A custom event doesn’t bubble and isn’t composed unless you set bubbles: true and composed: true. By default it reaches only the immediate parent that listens for it.
javascript
// child component
const evt = new CustomEvent('select', { detail: { recordId: this.recordId } });
this.dispatchEvent(evt);

// parent component's handler
handleSelect(event) {
console.log(event.detail.recordId);
}

The other options are wrong:

A: @wire is a decorator that reads data from the platform into a component property. It isn’t how an event’s payload is passed.
C: An event travels up to the parent, never down to a child. Parents pass data to children through public @api properties or methods.

Yassine - Oct 20, 2026

No.# Answer: C. FIND 'Universal Containers' IN Name Fields RETURNING Lead(Id, Name), Account(Id, Name), Contact(Id, Name)

Searching text across several objects at once is a job for SOSL (Salesforce Object Search Language), not SOQL. The FIND clause sets the search term, and RETURNING lists each object with the fields to return. Your options have a lot of OCR typos (“Conteiners”, “saceount”, “PIND”). I’m reading C as the corrected statement above.

apex
List<List<SObject>> results = [
FIND 'Universal Containers' IN NAME FIELDS
RETURNING Lead(Id, Name), Account(Id, Name), Contact(Id, Name)
];

The other options don’t fit:

A: It is SOSL, but IN CompanyName Fields isn’t a valid search scope. The valid scopes are ALL FIELDS, NAME FIELDS, EMAIL FIELDS, PHONE FIELDS and SIDEBAR FIELDS.
B and D: These are SOQL. SOQL can’t query several unrelated objects with FROM Lead, Account, Contact, and CompanyName isn’t a field on those objects. Searching across multiple objects takes SOSL.

Yassine - Oct 20, 2026

No.# Answer: C. Use the with sharing keyword.

This is the same idea as the Account search question you just asked. Apex runs in system mode by default and ignores the user’s record access. Declaring the class with sharing makes its queries return only records the logged-in user can access through ownership, roles, sharing rules and teams.

apex
public with sharing class RecordSearchController {
@AuraEnabled(cacheable=true)
public static List<Account> search(String term) {
String key = '%' + term + '%';
return [SELECT Id, Name FROM Account WHERE Name LIKE :key];
}
}

The other options:

A. WITH SECURITY_ENFORCED: It enforces object and field-level security, not record-level sharing. It throws an exception if the user can’t read a field in the query, and a query with it still returns records the user shouldn’t see if the class runs without sharing. It is a good addition, but it doesn’t answer “records accessible to the user”.
B. inherited sharing: The class takes the sharing mode of whatever calls it. When it is the entry point from an LWC, it runs as with sharing by default, so it can work here. It depends on the caller, though, and it is not the explicit guarantee the question asks for.
D. without sharing: It ignores sharing rules and exposes every record....

Mamie - Oct 18, 2026

Your PDI training material is very useful to me.

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Other Version
3080 viewsSalesforce.PDI.v2025-10-03.q93
9843 viewsSalesforce.PDI.v2025-01-09.q80
10249 viewsSalesforce.PDI.v2024-07-20.q115
14230 viewsSalesforce.PDI.v2023-09-20.q68
9251 viewsSalesforce.PDI.v2023-07-24.q102
12331 viewsSalesforce.PDI.v2023-03-21.q230
20516 viewsSalesforce.PDI.v2022-08-28.q103
8317 viewsSalesforce.PDI.v2022-08-15.q90
6217 viewsSalesforce.PDI.v2022-08-06.q88
11742 viewsSalesforce.PDI.v2022-06-29.q254
10703 viewsSalesforce.PDI.v2022-03-30.q75
9337 viewsSalesforce.PDI.v2022-02-09.q66
13034 viewsSalesforce.PDI.v2021-11-04.q66
8120 viewsSalesforce.PDI.v2021-10-29.q72
11446 viewsSalesforce.PDI.v2021-06-20.q54
9456 viewsSalesforce.PDI.v2021-06-08.q54
12593 viewsSalesforce.PDI.v2021-02-07.q59
14106 viewsSalesforce.PDI.v2020-03-22.q100
10664 viewsSalesforce.PDI.v2020-02-07.q82
Exam Question List
Question 1: Universal Containers has implemented an order management app...
Question 2: Universal Containers implemented a private sharing model for...
4 commentQuestion 3: While developing an Apex class with custom search functional...
Question 4: Which three Salesforce resources can be accessed from a Ligh...
Question 5: While working in a sandbox, an Apex test fails when run in t...
Question 6: A developer identifies the following triggers on the Expense...
Question 7: A developer is migrating a Visualforce page into a Lightning...
Question 8: A developer creates a custom exception as shown below: publi...
Question 9: Which annotation exposes an Apex class as a RESTful web serv...
Question 10: A developer is implementing an Apex class for a financial sy...
Question 11: Provide question feedback here (optional): (Exhibit) Based o...
Question 12: When using Salesforce DX, what does a developer need to enab...
2 commentQuestion 13: What should a developer use to obtain the Id and Name of all...
Question 14: What are three considerations when using the @lnvocableMetho...
Question 15: What are two ways a developer can get the status of an enque...
Question 16: A developer considers the following snippet of code: Based a...
Question 17: Which two statements are true about using the @testSetup ann...
Question 18: A developer is tasked with building a custom Lightning web c...
Question 19: A custom picklist field, Pool Preference_c, exists on a cust...
Question 20: What is an example of a polymorphic lookup field in Salesfor...
Question 21: A software company is using Salesforce to track the companie...
Question 22: When a user edits the Postal Code on an Account, a custom Ac...
Question 23: What are two benefits of using declarative customizations ov...
2 commentQuestion 24: Which two characteristics are true for Lightning Web Compone...
2 commentQuestion 25: Which three code lines are required to create a Lightning co...
Question 26: What is the value of the Trigger.old context variable in a b...
Question 27: Refer to the following Apex code: (Exhibit) What is the valu...
Question 28: Which action causes a before trigger to fire by default for ...
2 commentQuestion 29: Cloud Kicks has a multi-screen flow that its call center age...
Question 30: The Account object in an organization has a master-detail re...
Question 31: A developer is tasked to perform a security review of the Co...
Question 32: A developer created these three Rollup Summary fields in the...
Question 33: A developer created a child Lightning web component nested i...
2 commentQuestion 34: Which code in a Visualforce page and/or controller might pre...
Question 35: Universal Containers hires a developer to build a custom sea...
Question 36: (Full question statement) A developer must create a CreditCa...
Question 37: Universal Containers decided to transition from Classic to L...
Question 38: A company decides to implement a new process where every tim...
Question 39: A business has a proprietary Order Management System (OMS) t...
4 commentQuestion 40: A developer must implement a CheckPaymentProcessor class tha...
Question 41: Universal Containers has developed custom Apex code and Ligh...
Question 42: The Job _Application__c custom object has a field that is a ...
Question 43: A developer creates a Lightning web component that imports a...
Question 44: A developer creates a custom exception as shown below: publi...
1 commentQuestion 45: Consider the following code snippet: As part of the deployme...
Question 46: A developer must write an Apex method that will be called fr...
1 commentQuestion 47: A developer wants to mark each Account in a List&lt;Account&...
Question 48: A developer creates a new Apex trigger with a helper class, ...
1 commentQuestion 49: A software company uses the following objects and relationsh...
Question 50: Universal Containers (UC) processes orders in Salesforce in ...
Question 51: (Full question statement) Universal Containers recently tran...
Question 52: An Opportunity needs to have an amount rolled up from a cust...
Question 53: Which annotation should a developer use on an Apex method to...
Question 54: A developer needs to confirm that a Contact trigger works co...
Question 55: A developer has the following requirements: * Calculate the ...
1 commentQuestion 56: A Developer Edition org has five existing accounts. A develo...
Question 57: A developer is designing a new application on the Salesforce...
Question 58: A credit card company needs to implement the functionality f...
Question 59: Universal Containers (UC) wants to lower its shipping cost w...
Question 60: Given the following Anonymous block: (Exhibit) What should a...
Question 61: Which exception type cannot be caught?...
4 commentQuestion 62: Managers at Universal Containers want to ensure that only de...
2 commentQuestion 63: How many Accounts will be inserted by the following block of...
Question 64: A developer creates a batch Apex job to update a large numbe...
2 commentQuestion 65: A developer needs to allow users to complete a form on an Ac...
Question 66: A developer must create a Lightning component that allows us...
Question 67: Universal Containers is building a recruiting app with an Ap...
Question 68: A developer wants to import 500 Opportunity records into a s...
Question 69: Universal Containers (UC) uses a custom object called Vendor...
Question 70: What should a developer do to check the code coverage of a c...
Question 71: A developer needs to make a custom Lightning Web Component a...
Question 72: A Salesforce administrator used Flow Builder to create a flo...
1 commentQuestion 73: A developer needs to prevent the creation of Request_c recor...
1 commentQuestion 74: Consider the following code snippet: Given the multi-tenant ...
2 commentQuestion 75: A company has a custom object, order __c, that has a require...
Question 76: When importing and exporting data into Salesforce, which two...
Question 77: Universal Containers has a large number of custom applicatio...
Question 78: A development team wants to use a deployment script to autom...
Question 79: A developer is asked to prevent anyone other than a user wit...
Question 80: An org has an existing flow that edits an Opportunity with a...
Question 81: Which statement describes the execution order when triggers ...
Question 82: How can a developer check the test coverage of autolaunched ...
1 commentQuestion 83: The orderHelper class is a utility class that contains busin...
Question 84: A developer must troubleshoot to pinpoint the causes of perf...
3 commentQuestion 85: How is a controller and extension specified for a custom obj...
Question 86: A lead developer creates an Apex interface called Laptop. Co...
Question 87: The values 'High', 'Medium', and 'Low' are identified as com...
Question 88: Which Lightning Web Component custom event property settings...
1 commentQuestion 89: A developer deployed a trigger to update the status__c of As...
Question 90: An org has an existing flow that edits an Opportunity with a...
2 commentQuestion 91: A developer created a trigger on a custom object. This custo...
Question 92: A developer wants to mark each Account in a List&lt;Account&...
Question 93: A developer is asked to write helper methods that create tes...
Question 94: A developer needs to create a baseline set of data (Accounts...
2 commentQuestion 95: A developer is creating a Lightning web component to show a ...
Question 96: Universal Containers (UC) is developing a process for their ...