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!

Create an Account

Sign up to track your progress, earn points, and compete with others. Your solutions will be saved automatically.

Create account

How It Works

  • • Write your solution in the code editor
  • • Connect your Salesforce org to test
  • • Submit to check if your solution passes
  • • Use hints if you get stuck

Contest Alert

🏆 #CodeEveryDay June 2026

Contest runs June 1 - 30. Complete challenges to climb the leaderboard!

Only the 30 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