Salesforce Certification Salesforce Platform Developer I 2 — Questions and Answers
Question 1: What is the purpose of the @AuraEnabled annotation in Apex?
- Enables debug logging
- Exposes Apex methods to Lightning components (Correct answer)
- Marks a class as a web service
- Allows future method calls
Correct answer: Exposes Apex methods to Lightning components
@AuraEnabled makes an Apex method accessible from Lightning Aura or LWC components via JavaScript calls.
Question 2: Which Salesforce development concept ensures triggers handle multiple records at once?
- Recursion Prevention
- Trigger Bulkification (Correct answer)
- Governor Limit Bypass
- Context Variables
Correct answer: Trigger Bulkification
Trigger bulkification means writing trigger logic to handle collections (lists/maps) instead of single records to respect governor limits.
Question 3: What does the Apex 'Database.SaveResult' object return?
- The saved record ID and success/error details (Correct answer)
- A list of validation errors
- A map of field changes
- A rollback transaction log
Correct answer: The saved record ID and success/error details
Database.SaveResult contains the record ID if successful or error messages if the DML operation partially or fully fails.
Question 4: Which Apex interface must be implemented to schedule a class to run at a specific time?
- Database.Batchable
- Queueable
- Schedulable (Correct answer)
- Callable
Correct answer: Schedulable
The Schedulable interface requires implementing the execute(SchedulableContext sc) method and allows classes to be scheduled via cron.
Question 5: What is a Salesforce sandbox used for in the development lifecycle?
- Storing archived data
- Testing and development without affecting production (Correct answer)
- Hosting managed packages
- Running integrations with external APIs
Correct answer: Testing and development without affecting production
Sandboxes are copies of the production org used for development, testing, and UAT before deploying changes to production.
Question 6: Which Apex method is used to send an email programmatically from Salesforce?
- Messaging.SingleEmailMessage (Correct answer)
- Email.send()
- ApexEmail.compose()
- System.sendEmail()
Correct answer: Messaging.SingleEmailMessage
Messaging.SingleEmailMessage is the Apex class instantiated and populated before being sent via Messaging.sendEmail().
What is the purpose of the @AuraEnabled annotation in Apex?