This question runs in a pre-configured Salesforce environment - no personal connection required.
Write a method that queries all Accounts and updates each Account record with a revenue tier tag in the Description field based on their AnnualRevenue value.
Apply these tier classifications:
- Revenue >= 100000000 (100M+): Set Description to 'Enterprise Tier'
- Revenue >= 10000000 (10M+): Set Description to 'Mid-Market Tier'
- Revenue >= 1000000 (1M+): Set Description to 'SMB Tier'
- Revenue < 1000000 or null: Set Description to 'Startup Tier'
The method should return the total number of accounts that were updated (as Integer). Use bulk-safe DML operations and do not use DML statements inside loops.
Examples
// Account with AnnualRevenue = 225000000 // Description should be set to 'Enterprise Tier' // Account with AnnualRevenue = 15000000 // Description should be set to 'Mid-Market Tier' // Account with AnnualRevenue = 3000000 // Description should be set to 'SMB Tier' // Account with AnnualRevenue = 890000 // Description should be set to 'Startup Tier' // Account with AnnualRevenue = null // Description should be set to 'Startup Tier'
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
Contest Alert
🏆 All Time Leaderboard
Contest runs January 1, 1970 - December 31, 9999. Complete challenges to climb the leaderboard!
Points are calculated for challenges completed during the contest period.