This question runs in a pre-configured Salesforce environment - no personal connection required.
Write a method that returns the Name of the Opportunity with the earliest CloseDate. If two Opportunities share the same earliest CloseDate, return the one whose Name comes first alphabetically. Return null when there are no Opportunities.
Examples:
Input: (no parameters, queries all Opportunities)
Output: 'Deutsche Manufacturing - IoT Sensors'
Explanation: The value shown is illustrative. The method returns the Name of the Opportunity that closes earliest
Apex Code Editor
Welcome to Lightning Challenge!
How It Works
- • Write your solution in the code editor
- • This challenge runs without connecting your own org
- • Submit to check if your solution passes
- • Use hints if you get stuck
Note
You can test your code by connecting to Salesforce, but to save your progress and earn points, you'll need to create an account. Your solutions and achievements will be tracked automatically once you're logged in.