Salesforce Certified Platform Developer I Practice Questions
Prepare for DEV-450 with more than an answer.
Unlock the full exam and previous versions
- v1Salesforce Certified Platform Developer I 166 questions Locked
- DEV-450Legacy Salesforce Certified Platform Developer I 169 questions Current
- PDILegacy Salesforce Certified Platform Developer I 200 questions Locked
- Exam fee
- $200 USD
- Level
- Professional
- Valid for
- Must complete maintenance modules for each release
Domains covered on the exam 6
- Salesforce Fundamentals7%
- Data Modeling and Management13%
- Logic and Process Automation38%
- User Interface25%
- Testing7%
- Debug and Deployment Tools10%
- 1
A developer has a requirement to process 200,000
CampaignMemberrecords nightly to update their status based on complex criteria that cannot be achieved with declarative tools. The processing for each record is independent but must be completed without hitting governor limits. Which asynchronous Apex feature is the best choice for this scenario?Show answer details
Correct answer: C
Batch Apex is specifically designed for processing large numbers of records asynchronously. It breaks the job into manageable chunks (batches), and each chunk is processed in a separate transaction with its own set of governor limits. This allows the job to process millions of records without exceeding limits. The
start,execute, andfinishmethods provide a clear structure for querying records, processing them in batches, and performing final actions. - 2
When writing an Apex unit test, what is the purpose of the
Test.startTest()andTest.stopTest()methods?Show answer details
Correct answer: B
The
Test.startTest()andTest.stopTest()block serves two primary purposes. First, it creates a new, separate context for governor limits, allowing you to isolate the code you are specifically testing from test setup code. Second, any asynchronous processes (like@futureor Queueable Apex) called afterTest.startTest()are guaranteed to finish execution before the code afterTest.stopTest()runs, allowing you to assert their results. - 3
A developer needs to create a custom user interface for a complex, multi-step business process. The UI must be highly responsive, work seamlessly on mobile devices, and leverage modern web standards. Which UI framework should be the primary choice for this new development?
Show answer details
Correct answer: C
Lightning Web Components (LWC) is Salesforce's modern UI framework built on current web standards like Web Components, ES6+ JavaScript, and custom elements. It is designed for high performance, responsiveness, and mobile-first development. For any new custom UI development on the Salesforce platform, LWC is the recommended and superior choice over the older Visualforce and Aura frameworks.
- 4
Case Study: A global logistics company, ShipFast, uses Salesforce to manage shipments and customer accounts. They have a custom object,
Shipment__c, which has a Master-Detail relationship with the standardAccountobject. EachShipment__crecord has aStatus__cpicklist field (values: 'Pending', 'In Transit', 'Delivered', 'Cancelled') and aWeight_kg__cnumber field.New Requirement: The sales team wants to see two new fields on the
Accountrecord page:Total_Shipment_Weight__candHas_Pending_Shipments__c. TheTotal_Shipment_Weight__cfield should display the sum of theWeight_kg__cfrom all non-cancelledShipment__crecords. TheHas_Pending_Shipments__cshould be a checkbox that is checked if the account has at least oneShipment__crecord with a status of 'Pending'. The solution must be efficient and avoid custom code if possible.How should a developer implement these requirements?
Show answer details
Correct answer: B
This is the optimal declarative solution. The Master-Detail relationship between
AccountandShipment__callows for the use of Roll-Up Summary fields. The first Roll-Up Summary field can directly calculate the SUM ofWeight_kg__cwhile filtering out 'Cancelled' shipments. The second Roll-Up Summary field can COUNT the number of 'Pending' shipments. A simple formula field can then reference this count to display a checkbox (IF(Pending_Shipment_Count__c > 0, true, false)), satisfying both requirements without any Apex code, which is more efficient and maintainable. - 5
A business process requires that when a high-value
Opportunityis updated, a complex credit-worthiness calculation is performed, and an external risk assessment system is notified via a callout. The entire process must be auditable and allow for retries on failure. The logic is too complex for a flow. Which asynchronous Apex feature should be used?graph TD A[Opportunity Update] --> B{High Value?}; B -->|Yes| C[Perform Complex Calc]; C --> D[Callout to Risk System]; D --> E{Success?}; E -->|Yes| F[Log Success]; E -->|No| G[Log Failure & Allow Retry];Show answer details
Correct answer: C
Queueable Apex is the best choice here. It supports callouts, can handle complex sObjects as parameters (unlike future methods), and provides a job ID that can be used for monitoring and auditability. Crucially, a Queueable job can enqueue another job, which is a common pattern for implementing retry logic on failure. Batch Apex is for processing large data volumes, and future methods are simpler but lack the job ID and chaining capabilities needed for this requirement.
- 6
A developer is tasked with creating a Visualforce page that displays a list of
OpportunityLineItemrecords for a givenOpportunity. The page must allow users to edit theQuantityandUnitPricefields inline and save all changes with a single button click. The number of line items can exceed 100. Which controller approach is most suitable and efficient for this requirement?Show answer details
Correct answer: C
A custom controller with a wrapper class is the most robust solution. The wrapper class can encapsulate the
OpportunityLineItemsObject and any additional properties needed for the page, such as a boolean for row selection or temporary edit values. This approach provides maximum flexibility for handling complex page logic, especially for inline editing of multiple records, without being constrained by the features of standard controllers. The save method can then iterate through the list of wrappers, collect the modified records, and perform a single DML update, which is efficient. - 7
A company has a business rule that when an Opportunity's
StageNameis updated to 'Closed Won', a correspondingContractrecord must be created and linked to the Opportunity'sAccount. This process involves complex logic, including calling a web service to get a contract number. To ensure the system remains maintainable and scalable, which automation tool is the best fit for this requirement?Show answer details
Correct answer: B
An Apex trigger is the best choice because the requirement includes making a web service callout. While Flow can make callouts, performing a callout directly from a record-triggered path (like a trigger) must be done asynchronously to avoid holding up the database transaction. An Apex trigger can invoke an asynchronous Apex method (using the
@future(callout=true)annotation) to perform the web service call. This cleanly separates the synchronous record update from the asynchronous external communication, which is a best practice and necessary to avoid aCalloutException. - 8
A developer needs to write an Apex test class for a trigger on the
Caseobject. The trigger logic depends on theRecordTypeof the Case. To ensure the test is reliable and does not depend on existing data in the org, what is the recommended way to get theRecordTypeIdwithin the test method?Show answer details
Correct answer: C
Using the Schema methods like
getRecordTypeInfosByName()is the best practice for obtaining RecordType IDs within a test context. This approach is dynamic and does not rely on hard-coded IDs, which can change between environments (e.g., sandboxes, production). It also avoids making a SOQL query, which consumes a governor limit. Furthermore, it does not requireSeeAllData=true, ensuring the test remains isolated and reliable. - 9
A financial services company is modeling its data in Salesforce. They have a custom object
Financial_Advisor__cand another custom objectClient__c. An advisor can manage many clients, but each client must be assigned to exactly one advisor. If an advisor leaves the company and their user record is deleted, all associated client records must also be deleted automatically. Which type of relationship should be created on theClient__cobject to link it to theFinancial_Advisor__cobject?Show answer details
Correct answer: A
A Master-Detail relationship is the correct choice. This relationship type creates a tight coupling where the detail (child) record's existence depends on the master (parent) record. Key features that meet the requirements are: 1) The detail record inherits the sharing and security settings of the master record. 2) Deleting the master record automatically deletes all related detail records (cascade delete). 3) The relationship field on the detail record is required by default, ensuring every client is assigned to an advisor.
- 10
A developer needs to deploy a new Apex class, a new Lightning Web Component, and a modification to an existing Profile from a Developer Sandbox to a Full Sandbox for UAT. Which deployment tools can be used to accomplish this? (Select TWO)
Show answer details
Correct answer: A, C
Change Sets are a native Salesforce UI-based tool used to move metadata between connected orgs (like from a sandbox to another sandbox or production). They can package Apex classes, Lightning Web Components, and Profiles, meeting all the requirements of the scenario.
The Salesforce CLI (SFDX) is a powerful command-line tool for Salesforce development and deployment. A developer can retrieve the specified metadata components from the source org and deploy them to the target org. This method offers more control, is scriptable, and is a core part of modern DevOps processes.
