
4 answers
Hi Mahantesh,It's not possible to use more than 150 DML statements in a single apex transaction.If you need to insert/update/delete many records you can do so by calling a DML statement on a list.For example, to insert 150 new accounts you could do this.
Hope that helps,Clint// create 150 accounts
List<Account> accounts = new List<Account>();
for(Integer i = 0; i < 150; i++)
{
Account account = new Account(Name = 'Test Account');
accounts.add(account);
}
insert accounts; // insert the entire list - this only consumes 1 DML statement.