Salesforce-Platform-Developer Practice Test
Updated On 18-Sep-2025
237 Questions
A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a Salary c custom field. What should the developer use, along with a lightning-record-edit-form, so that Salary__c field functions as a currency input and is only viewable and editable by users that have the correct field level permissions on Salary _c?
A. A.
B. B.
C. C.
D. D.
Explanation:
To create a form that:
Lets users input data for a Contact record (including a custom Salary__c field),
Automatically renders currency formatting for a Currency field, and
Respects field-level security (FLS) (so only users with access can view or edit it),
You should use the
Why C is correct:
It also respects FLS — users without view or edit permission won’t see or be able to change the field.
It’s the recommended way to include fields in lightning-record-edit-form.
The other options (A, B, D):
Likely involve either manual input fields like
Do not automatically respect FLS, and
Require extra work to validate and submit data properly.
The values 'High', 'Medium', and 'Low' are Identified as common values for multiple picklist across different object. What is an approach a developer can take to streamline maintenance of the picklist 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 alphabeticaly, not in the order entered".
C. Create the Picklist on each object and select "Restrict picklist to the values defined in the value set".
D. Create the Picklist on each and add a validation rule to ensure data integrity.
Explanation:
When multiple objects use the same picklist values (e.g., 'High', 'Medium', 'Low'), the best practice is to:
Define the values once in a Global Picklist Value Set, and
Reference it when creating picklist fields on different objects.
This makes it easier to manage and update values centrally, while also restricting entries to just the predefined list.
Why the other options are incorrect:
B. Alphabetical display setting – Only affects the order of display, not maintenance or restrictions.
C. "Restrict picklist to values defined in value set" – This is good practice, but without using a Global Value Set, you’d have to maintain values separately on each object.
D. Validation rule to ensure data integrity – Not efficient or scalable; better handled with restricted picklists and value sets.
A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration chat reads task records is periodically reporting errors. Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?
A. Deactivate the trigger before the integration runs.
B. Use a try-catch block after the insert statement.
C. Remove the Apex class from the integration user's profile.
D. Use the Database method with all or None set to false
Explanation:
When inserting records in Apex, using Database.insert(records, false) with allOrNone=false allows partial success:
Successful records are committed,
Failed records are skipped,
No unhandled exceptions are thrown.
This prevents the entire transaction from failing, which helps ensure that external integrations (like the one reading Task records) aren’t disrupted by rare insert failures in the trigger.
Which aspect of Apex programming is limited due to multitenancy?
A. The number of active Apex classes
B. The number of methods in an Apex Class
C. The number of records processed in a loop
D. The number of records returned from database queries
Explanation:
Salesforce operates in a multitenant architecture, meaning multiple organizations share the same infrastructure. To ensure fair resource distribution and prevent individual tenants from monopolizing system resources, Salesforce imposes governor limits, including constraints on database queries.
Governor Limit on SOQL Queries:
Apex allows a maximum of 50,000 records to be retrieved per transaction.
If a query exceeds this limit, it throws an exception, preventing excessive database resource consumption.
A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List
The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?
A. Use the System.Limits.getQueries() method to ensure the number of queries is less than 100.
B. Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100.
C. Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids.
D. Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.
Explanation:
The current code performs a SOQL query inside a loop, which can easily exceed the governor limit of 100 queries per transaction. This is a common anti-pattern in Apex.
Refactor to use a single SOQL query
The best practice is to bulkify the code by querying all OpportunityLineItems in one SOQL statement using the IN keyword:
public class without sharing OpportunityService {
public static List
return [SELECT Id FROM OpportunityLineItem WHERE OpportunityId IN :opportunityIds];
}
}
This approach uses 1 SOQL query, regardless of how many Opportunity IDs are passed in.
It ensures governor limits are not exceeded, even in bulk operations.
Why the other options are incorrect:
A. Use System.Limits.getQueries()
This checks how many queries have been used, but doesn't prevent the issue—just monitors it.
B. Use System.Limits.getLimitQueries()
This gives the total limit (typically 100), but again, doesn’t avoid SOQL-in-loop problems.
C. Limit logic to Sets with <100 IDs
This doesn't help. Even with <100 IDs, if you run 1 SOQL per ID, you still risk hitting the limit in other parts of the transaction.
Page 1 out of 48 Pages |