This question runs in a pre-configured Salesforce environment - no personal connection required.
Query all Account records that have a non-null BillingCity but a null Site field. For each of these accounts, set the Site field to match the BillingCity value. Update all matching accounts in a single DML operation and return the number of accounts updated. Return 0 if no accounts need updating.
Examples:
Input: (no parameters - queries and updates org data)
Output: 5
Explanation: 5 accounts had a BillingCity but no Site, all were updated
Input: (all accounts already have Site populated)
Output: 0
Explanation: No accounts needed updating
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.