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

Query all Account records where ShippingStreet is null but BillingStreet is not null. For each such Account, copy the billing address fields (BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry) to the corresponding shipping address fields (ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry). Perform a single bulk update for all modified accounts.

Examples:

Input: (no parameters - operates on org data) Before: Account with BillingStreet = '123 Main St', ShippingStreet = null After: Account.ShippingStreet = '123 Main St' (copied from billing) Explanation: ShippingStreet was null so it gets copied from BillingStreet Before: Account with BillingStreet = null, ShippingStreet = null After: No change Explanation: No billing address to copy from Before: Account with BillingStreet = '456 Oak Ave', ShippingStreet = '789 Pine Rd' After: No change Explanation: ShippingStreet already populated, do not overwrite
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