This question runs in a pre-configured Salesforce environment - no personal connection required.
Given an industry name, update the Description field of all accounts in that industry. Set each account Description to the format: "AccountName - Rating" (use "Unrated" if the Rating field is null). Return the number of accounts updated. Return 0 for null or blank industry input.
public static Integer updateAccountDescriptions(String industry)
Examples:
Input: industry = 'Technology'
Output: 3
Explanation: Three Technology accounts updated with new descriptions
Input: industry = 'NonExistentIndustry'
Output: 0
Explanation: No accounts found for this industry
Input: industry = null
Output: 0
Input: industry = ''
Output: 0
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 accountHow 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 Mar/April 2026
Contest runs March 3 - April 30. Complete challenges to climb the leaderboard!
Points are calculated for challenges completed during the contest period.