How many accounts are in the org after this code is run? A developer - ProProfs Discuss
Topics
Products
Follow Us:

How many accounts are in the org after this code is run? A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:Account myAccount = new Account(Name = 'MyAccount');Insert myAccount;For (Integer x = 0; x < 150; x++) {Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;} catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount');

This question is part of Salesforce Platform Developer 1
Asked by Cmduquer, Last updated: Jan 23, 2020

+ Answer
Request
1

2 Answers

ozanbotan

Ozanbotan

Answered Oct 24, 2018

System.LimitException: Too many DML statements: 151

so, roll back. and nothing will be inserted.

1
 

cmduquer

Cmduquer

Answered Sep 25, 2018

100

####
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.