This question runs in a pre-configured Salesforce environment - no personal connection required.
Every open Opportunity in the org needs its Amount rounded up to the next whole multiple of 10,000 so the pipeline reports in clean blocks.
Find every Opportunity where IsClosed is false and Amount is not null, round each Amount up to the next multiple of 10,000, save them all with a single update statement, and return how many records were updated.
An Amount that already sits exactly on a multiple of 10,000 stays where it is. Closed Opportunities must not be touched. If nothing needs updating, return 0 and run no DML at all.
Examples:
Amount = 12500 -> 20000
Explanation: 12,500 sits between 10,000 and 20,000 so it rounds up to 20,000
Amount = 250000 -> 250000
Explanation: The amount is already an exact multiple of 10,000 so it stays put
Amount = 1 -> 10000
Explanation: Anything above zero rounds up to at least the first block
Return value:
Output: the number of open Opportunity records that were updated
Explanation: Closed Opportunities and records with a null Amount are never counted
Empty case:
Output: 0
Explanation: With no matching records the method returns 0 and issues no DML
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
Contest runs December 1 - 31. Complete challenges to climb the leaderboard!
Prize 1: Salesforce certification exam voucher — won by random drawing, where every point is a ticket. see all prizes
Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.