This question runs in a pre-configured Salesforce environment - no personal connection required.

Query all Account records where Rating equals 'Cold'. Set the Description field to null for each account. Update all the accounts with DML and return the list of updated accounts.

Cold-rated accounts are typically deprioritized in sales pipelines. Clearing their descriptions can be part of a data cleanup process, removing outdated notes so the records remain organized and current.

Method Signature

public static List<Account> clearColdDescriptions()

Examples

Input: (no parameters - queries the org directly) Output: List of Account records that were updated (Rating = 'Cold', Description = null) Explanation: All Cold-rated accounts have their Description field cleared
Scenario: Before execution, some Cold accounts may have descriptions After execution: All Cold accounts have Description = null Explanation: The method updates all Cold-rated accounts and returns them
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

🏆 #CodeEveryDay May 2026

Contest runs May 1 - 31. 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