This question runs in a pre-configured Salesforce environment - no personal connection required.
Query all Accounts that have a non-null AnnualRevenue. Set the Rating field on each Account based on the following rules: set Rating to 'Hot' if AnnualRevenue is greater than or equal to 1,000,000; set Rating to 'Warm' if AnnualRevenue is greater than or equal to 100,000 and less than 1,000,000; set Rating to 'Cold' if AnnualRevenue is less than 100,000. After setting the Rating field on each Account, perform a bulk update using a single DML statement.
Examples:
Input: (no parameters - operates on org data)
Before: Account with AnnualRevenue = 2000000, Rating = null
After: Account.Rating = 'Hot'
Explanation: AnnualRevenue >= 1000000 maps to Hot
Before: Account with AnnualRevenue = 500000, Rating = null
After: Account.Rating = 'Warm'
Explanation: AnnualRevenue >= 100000 and < 1000000 maps to Warm
Before: Account with AnnualRevenue = 50000, Rating = null
After: Account.Rating = 'Cold'
Explanation: AnnualRevenue < 100000 maps to Cold
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.