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

Given a list of Opportunity records, advance every opportunity in the Proposal/Price Quote stage to the Negotiation/Review stage. Update only the changed records in a single DML statement and return how many were advanced. Return 0 for null or empty input.

Example 1:

Input: opps = [list of 8 opportunities in Proposal/Price Quote stage] Output: 8 Explanation: All 8 opportunities have their StageName changed to Negotiation/Review and updated in a single DML call. The method returns 8.

Example 2:

Input: opps = null Output: 0 Explanation: Null input returns 0 immediately without performing any DML.

Example 3:

Input: opps = [] (empty list) Output: 0 Explanation: An empty list returns 0 without performing any DML.

Example 4:

Input: opps = [list of Closed Won opportunities] Output: 0 Explanation: None of the records are in the Proposal/Price Quote stage so none are advanced and 0 is returned.
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

Note

You can test your code by connecting to Salesforce, but to save your progress and earn points, you'll need to create an account. Your solutions and achievements will be tracked automatically once you're logged in.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In