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

Given a list of Contact record IDs, set the Department field to "Inactive" for all of them using a single DML update operation. Query the contacts first using the provided IDs, set Department = "Inactive" on each, then perform a bulk update. If the list is empty, do nothing.

Examples:

Input: (no return value - modifies org data) contactIds = [Id1, Id2, Id3] Before: Contact Id1.Department = "Sales", Id2.Department = "Marketing", Id3.Department = null After: Contact Id1.Department = "Inactive", Id2.Department = "Inactive", Id3.Department = "Inactive" Explanation: All three contacts are updated in a single DML call contactIds = [] Before/After: No change Explanation: Empty list results in no DML operation
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

🏆 #CodeEveryDay July 2026

Contest runs July 1 - 31. Complete challenges to climb the leaderboard!

Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In