Challenges

Insert Accounts from Names List

Complete the method createAccountsFromNames that accepts a List<String> parameter accountNames. The method should create and insert Account records where each Account's Name field is set to one of the strings in the list. The method should return the list of inserted Accounts.

For example, if given the list ['Acme Corp', 'Global Tech'], you should insert two Account records with those names and return them.

Editor
Test Results

Result Panel

Hit the run button to test your code!