Here’s a list of Apex Practice Question – Part 2 scenarios questions for practice, covering beginner to intermediate levels and Intermediate to Advanced levels: Beginner Level: Intermediate Level: Advanced
- Write an Apex class that creates a new Account record with the given name and phone number.
- Create an Apex class to update the email address of a Contact record based on the provided Contact Id.
- Develop an Apex class that retrieves all Opportunities with a Close Date within the current month and updates their Stage to “Closed Won”.
- Write an Apex class that checks the priority of a Case record and if it is “High”, assign it to a specific user with a higher escalation level.
- Implement an Apex class that converts a Lead record into an Account, Contact, and Opportunity record based on specific criteria.
- Create an Apex class to dynamically create a custom object with the provided object name and custom fields.
- Develop an Apex class that updates the Status of Campaign Members for a given Campaign based on the provided criteria.
- Write an Apex class that sends an email notification to a specific set of users with the given subject and body content.
- Implement an Apex class that deletes all records of a specified object type older than a certain date.
- Create an Apex class that retrieves all Case Comments for a specific Case and displays them in a formatted manner.
- Develop an Apex class that retrieves all child Accounts for a given parent Account and displays them in a hierarchical structure.
- Write an Apex class that assigns Leads to different users based on specific criteria such as Lead source and geographic location.
- Create an Apex class that calculates the total value of Opportunities in each stage and presents the results in a graphical format.
- Implement an Apex class that identifies and displays potential duplicate records based on specific field-matching criteria.
- Develop an Apex class that validates the data entered in a custom object record based on predefined business rules.
- Write an Apex class that reads data from an external CSV file and imports it into Salesforce using DML operations.
- Create an Apex class that sends a personalized email to a list of Contacts or Leads using an email template.
- Implement an Apex class that sends an email notification to a specified user when a Case remains unresolved for a certain duration.
- Develop an Apex class called that updates the parent Account of a given set of child Accounts based on specific criteria.
- Write an Apex class named that reads data from an external system and imports it as Campaign Members in Salesforce.
- Develop an Apex class that allows users to search for Account records based on specified criteria such as name, industry, or location.
- Write an Apex class that identifies and merges duplicate Contact records based on matching criteria such as email or phone number.
- Implement an Apex class that predicts the potential revenue of Opportunities based on historical data and opportunity stage probabilities.
- Create an Apex class named that exports data from a custom object into a CSV file and provides it as a downloadable attachment.
- Develop an Apex class that analyzes the conversion rate and success metrics of Lead conversions in a given time period.
- Write an Apex class that archives old records of a specific object by moving them to a separate archive object for long-term storage.
- Implement an Apex class that automatically assigns Cases to specific user or queue based on predefined assignment rules and criteria.
- Create an Apex class that generates custom reports based on user-selected criteria and displays them in a tabular or graphical format.
- Develop an Apex class that allows users to manage and update email templates used for various email communications in Salesforce.
- Write an Apex class that validates the data entered in specific fields of a record based on predefined validation rules and displays error messages accordingly.
- Develop an Apex class that updates the parent Account of a given set of child Accounts based on specific criteria.
- Implement an Apex class that automatically assigns Cases to specific users or queues based on predefined assignment rules and criteria.
- Create an Apex class that generates custom reports based on user-selected criteria and displays them in a tabular or graphical format.
- Develop an Apex class that allows users to manage and update email templates used for various email communications in Salesforce.
- Write an Apex class that validates the data entered in specific fields of a record based on predefined validation rules and displays error messages accordingly.