function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Satya Prakash 11Satya Prakash 11 

Inserting Bulk records using Apex coding

Can any one let me know how to insert bulk records using Apex coding. Here is the requirement.

I need to insert 10 Account records and for each Account record need to associate 2 Contacts and 2 Opportunities. Please let me know the code to be executed from Developer Console.

At last we should have 10 Account records, 20 Contacts and 20 Opportunities.
AshwaniAshwani
You should use Apex batch if you have list of record in Salesforce.

Alternatively, you can use Dataloader to insert record in any number you want.