Salesforce PDI Exam Questions

Questions for the PDI were updated on : Dec 14 ,2025

Page 1 out of 14. Viewing questions 1-15 out of 201

Question 1

(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
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
A (Correct):lightning-input-field is part ofLightning Data Service (LDS), and itautomatically enforces
field-level security (FLS)and CRUD rules. This is thebest practicefor handling sensitive data in LWC
forms and ensures compliance with user-level permissions.
Incorrect options:
B:force:inputField is used inAura, not in Lightning Web Components.
C/D:These are deprecated or older framework components that donotinherently enforce FLS.
Reference:LWC Developer Guide – lightning-input-field
This topic relates toUser Interface (25%)andsecurity in LWC development, a key concept in the PD1
exam.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

Which two events need to happen when deploying to a production org?
Choose 2 answers

  • A. All custom objects must have visibility set to a value other than in Development.
  • B. All Apex code must have at least 75% test coverage.
  • C. All triggers must have some test coverage
  • D. All Visual flows must have at least 1% test coverage.
Answer:

B,C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
B: Salesforce requires that all Apex code have at least 75% test coverage in production before
deployment. This ensures that the system remains reliable.
C: All triggers must have some test coverage as part of the overall 75% requirement for Apex code.
Why not other options?
A: Object visibility settings are not a deployment requirement.
D: Visual Flows do not require test coverage for deployment to production.
:
Apex Test Coverage Requirements

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

A developer is integrating with a legacy on-premise SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in
Salesforce?

  • A. External Object
  • B. External ID field
  • C. Formula field
  • D. Lookup field
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
AnExternal ID fieldis used to match data in Salesforce with data from external systems (like an on-
premise SQL database). It allows for easy upserts and data integration without relying on Salesforce
IDs.
Why not other options?
A: External objects are used for real-time integration with external systems but do not address data
matching directly.
C: Formula fields are calculated fields and cannot be used for data matching.
D: Lookup fields are used for creating relationships between objects within Salesforce, not for
matching external data.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

A developer needs to confirm that a Contact trigger works correctly without changing the
organization's data.
What should the developer do to test the Contact trigger?

  • A. Use Deploy from the VSCode IDE co deploy an 'insert Contact' Apex class.
  • B. Use the New button on the Salesforce Contacts Tab to create a new Contact record.
  • C. Use the Test menu on the Developer Console to run oil test classes for the Contact trigger.
  • D. Use the Open Execute Anonymous feature on the Developer Console to run an "insert Contact' DML statement.
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
TheTest menu in the Developer Consoleallows the developer to run specific or all test classes,
ensuring that the trigger works correctly without affecting production data. Test methods in
Salesforce run in an isolated environment and do not modify the actual data.
Why not other options?
A: Deploying code does not confirm that the trigger works correctly.
B: Creating a new Contact directly modifies production data, which is not recommended.
D: Executing a DML statement in Execute Anonymous directly affects production data and is not a
safe testing method.
:
Testing Apex Triggers

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

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 accesscontrol.
  • C. Use the Data Import Wizard to import the data arid set up field-level security to restrict access tosensitive fields.
  • D. Use the Salesforce CLI to import the data and set up user permissions to restrict access to sensitive data.
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
The Data Import Wizard allows importing data while adhering to Salesforce's sharing and security
model. By setting field-level security, sensitive fields can be hidden from unauthorized users.
Other Options:
Option A: Encrypting data externally is unnecessary since Salesforce has built-in security features.
Option B: Using the Data Loader with Apex adds unnecessary complexity.
Option D: The Salesforce CLI does not provide direct data import capabilities with security settings.
:Data Import Wizard Documentation

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Which Apex class contains methods to return the amount of resources that have been used for a
particular governor, such as the number of DML statements?

  • A. OrgLimits
  • B. Limits
  • C. Messaging
  • D. Exception
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
TheLimitsclass in Apex provides methods to check the consumption of governor limits, such as the
number of SOQL queries, DML statements, and heap size used.
Example:
Integer dmlStatements = Limits.getDMLStatements();
Integer dmlLimit = Limits.getLimitDMLStatements();
Not Suitable:
Option A:OrgLimitsis not an Apex class.
Option C:Messagingdeals with email and messaging operations.
Option D:Exceptionis for handling exceptions, not tracking resource usage.
:Limits Class
Reference:Apex Developer Guide – Limits Class
This concept falls under"Testing, Debugging, and Deployment"(22% weight) in the PD1 guide, as
developers need to monitor and test for governor limits to ensure Apex code scalability and
reliability.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Which action causes a before trigger to fire by default for Accounts?

  • A. Renaming or replacing picklists
  • B. updating addresses using Mass Address updated tool
  • C. Importing data using the Data Loader and the Bulk API
  • D. Converting Leads to Contacts
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Abefore triggerfires when records are inserted, updated, or deleted. Using the Data Loader or Bulk
API to import data updates records, which triggers thebefore insertorbefore updateevents.
Not Suitable:
Option A: Renaming or replacing picklists does not trigger a record-level operation.
Option B: The Mass Address Update tool is not a record operation that triggersbeforetriggers.
Option D: Converting leads to contacts triggers lead conversion events, not directly related to
Account triggers.
:Apex Triggers

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

Management asked for opportunities to be automatically created for accounts with annual revenue
greater than $1, 000,000. A developer created the following trigger on the Account object to satisfy
this requirement.
for (Account a : Trigger.new) {
if (a.AnnualRevenue > 1000000) {
List<Opportunity> oppList = [SELECT Id FROM Opportunity WHERE AccountId = :a.Id];
if (oppList.size() == 0) {
Opportunity oppty = new Opportunity(Name = a.Name, StageName = 'Prospecting', CloseDate =
System.today().addDays(30));
insert oppty;
}
}
}
Users are able to update the account records via the UI and can see an opportunity created for high
annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts
using Data Loader, it fails with system, Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2. answers

  • A. Query for existing opportunities outside the for loop.
  • B. Check if all the required fields for Opportunity are being added on creation.
  • C. Move the DML that saves opportunities outside the for loop.
  • D. Use Database query to query the opportunities.
Answer:

A,C

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
This is a classicbulkification problem, covered under"Apex Development Best Practices"in the PD1
guide.
Reference:Apex Developer Guide – Bulk Design Patterns
D (Correct):DML operations (like insert) in a loop can cause theDML 151 limiterror. Moving them
outside the loop and collecting records in a list before performing a single DML operation is best
practice.Reference:Salesforce Platform Developer I Study Guide – Process Automation and Logic
(30%)

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

What is a benefit of developing applications

  • A. Enforced unit testing and code coverage best practices
  • B. Access to predefined computing resources
  • C. Preconfigured storage for big data
  • D. Unlimited processing power and memory
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

Universal Containers (UC) is developing a process for their sales teams that requires all sales reps to
go through a set of scripted steps with each new customer they create.
In the first step of collecting information, UC's ERP system must be checked via a REST endpoint to
see if the customer exists. If the customer exists, the data must be presented to the sales rep in
Salesforce.
Which two should a developer implement to satisfy the requirements?
Choose 2 answers

  • A. Flow
  • B. Invocable method
  • C. Future method
  • D. Trigger
Answer:

A,B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
A: A Flow can guide sales reps through a set of scripted steps and call an Apex action to interact with
an external REST endpoint.
B: An Invocable method is used to make an Apex method callable from a Flow. This method can call
the REST endpoint and return the data for display.
Why not other options?
C: Future methods are asynchronous and cannot return data to the user in real time.
D: Triggers are used for database events, not for guiding users through scripted processes or making
REST calls.
:
Invocable Methods in Flows

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 2 answers

  • A. <apex includeLightning/>
  • B. $LightningcreateComponent
  • C. $Lightning,use
  • D. <apexslds/>
  • E. #Lightning,useComponent
Answer:

A,C

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
To embed a Lightning component in a Visualforce page, the following are required:
A:<apex:includeLightning/>is necessary to include the Lightning framework on the Visualforce page.
C:$Lightning.use()initializes the Lightning app and is essential for using Lightning components.
Why not other options?
B:$Lightning.createComponentis used for creating a specific Lightning component but is not enough
on its own.
D:<apex:slds/>includes SLDS (Styling) but is unrelated to embedding Lightning components.
E: This is not a valid syntax.
:
Embedding Lightning Components in Visualforce

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

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.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Master-detail relationships allow roll-up summary fields to aggregate data from child records. If a
roll-up summary field exists on the Account object, the relationship cannot be changed to a lookup
because lookup relationships do not support roll-up fields.
Why not other options?
A: Null values in the Vendor records do not prevent the change.
C: Custom fields can have their types changed as long as dependencies like roll-up fields are not
present.
D: Organization-wide defaults do not affect the ability to change relationships.
:
Salesforce Master-Detail Relationships and Roll-Up Summary Fields

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

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
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
When an Account record is created, the following happens:
Before insert triggerincrements the count field once.
After insert record-triggered flowexecutes and increments the count again.
When the record is subsequently updated:
Before update triggerincrements the count again.
After update record-triggered flowincrements it once more.
Thus, the final value of thecountfield =4.
:
Order of Execution in Salesforce

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

What should be used to create scratch orgs?

  • A. Salesforce CLI
  • B. Sandbox refresh
  • C. Developer Console
  • D. Workbench
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
Scratch orgs are created using the Salesforce CLI (sfdx force:org:create) as part of Salesforce DX. It is
specifically designed for development and testing purposes.
Why not other options?
B: Sandbox refresh is used for creating sandboxes, not scratch orgs.
C: Developer Console is used for debugging and code development but cannot create scratch orgs.
D: Workbench is a tool for API testing and data manipulation, not for scratch org creation.
:
Salesforce CLI and Scratch Orgs

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

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.
Answer:

A,B,C

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
Upload the SVG file as astatic resourcein Salesforce.
Import it in the LWC JavaScript file and define it as a property.
Reference the property in the component’s HTML template.
Example:
importmySvgfrom'@salesforce/resourceUrl/mySvg';
exportdefaultclassMyComponentextendsLightningElement{
svgUrl = mySvg;
}
:Lightning Web Components Static Resources

Discussions
vote your answer:
A
B
C
D
E
0 / 1000
To page 2