This question runs in a pre-configured Salesforce environment - no personal connection required.
Take a List of String account names and create new Account records with those names. Set Type to Prospect and Rating to Cold for all accounts. Insert all records in bulk and return the List of Account records with their new IDs. Return an empty list if the input is null or empty.
Examples:
Input: accountNames = ['Acme Corp', 'Global Industries', 'Tech Solutions']
Output: List of 3 Account records with IDs, Type='Prospect', Rating='Cold'
Explanation: Creates 3 new Account records with the provided names and specified field values
Input: accountNames = []
Output: []
Explanation: Returns empty list when input is empty
Input: accountNames = null
Output: []
Explanation: Returns empty list when input is null
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 accountHow 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
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.