• Jonathan Hsu 4
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I need to be able to make a list of accounts and an opportunity within each newly created account. What's the most efficient way to do this?

Currently, my plan is to create a List<Account> and do a Database.insert() then for each Id, add an opportunity to List<Opportunity> then do another Database.insert().

Is there a better way?
I need to be able to make a list of accounts and an opportunity within each newly created account. What's the most efficient way to do this?

Currently, my plan is to create a List<Account> and do a Database.insert() then for each Id, add an opportunity to List<Opportunity> then do another Database.insert().

Is there a better way?