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!

Create an Account

Sign up to track your progress, earn points, and compete with others. Your solutions will be saved automatically.

Create account

How It Works

  • • Write your solution in the code editor
  • • Connect your Salesforce org to test
  • • 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.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In