Plat-Dev-201 Exam Questions & Answers
Salesforce Certified Platform Developer • Salesforce
100% money-back guarantee
Sample Plat-Dev-201 Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
(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.
Comprehensive and Detailed Explanation From Exact Extract:
A (Correct):AnApproval Processcan lock a record (making it read-only) once the record meets certain criteria like stage = Closed/Won.
B (Correct):AValidation Rulecan prevent users from saving changes when the stage is Closed/Won, by throwing an error.
Example validation formula:
text
CopyEdit
AND(ISCHANGED(StageName), ISPICKVAL(StageName, 'Closed Won'))
Incorrect options:
C:Before triggers run before the record is saved but don't prevent UI-level edits unless combined with DML rollbacks or errors.
D:Auto-response rules are for sending emails, not restricting edits.
This topic relates to bothProcess Automation and Logic (30%)andSecurity and Data Integritypractices.
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?
Maximum Trigger Depth Exceeded:
This error occurs when a trigger causes recursive calls, leading to an infinite loop of execution.
Solution:
Use static variables in helper classes to prevent recursive trigger execution.
Example:
public class TriggerHelper {
public static Boolean isTriggerExecuted = false;
}
trigger AccountTrigger on Account (after update) {
if (!TriggerHelper.isTriggerExecuted) {
TriggerHelper.isTriggerExecuted = true;
// Trigger logic here
}
}
Why Not Other Options?
A: Permissions do not affect trigger recursion.
B: Length of the trigger is unrelated to recursion.
C: Code coverage does not influence runtime errors like recursion.
What should be used to create scratch orgs?
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
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:Using the order number as an external ID ensures Salesforce can identify and update existing records instead of creating duplicates during updates.
B:Ensuring the order number is unique in the OMS guarantees that there will not be multiple records in Salesforce corresponding to a single order.
Incorrect Options:
C:Email on the contact is unrelated to the uniqueness of order records.
D:Deleting duplicates with triggers is reactive and not a best practice.
What are three considerations when using the @lnvocableMethod annotation in Apex?
Choose 3 answers
Option A: Only one method annotated with@InvocableMethodcan exist per class.
Option C: The method must bestatic.
Option E: The method can be declared asPublicorGlobalfor broader accessibility.
:Invocable Methods Documentation
Get access to all 204 verified questions with detailed answers.
Unlock All Plat-Dev-201 Questions