I am literally done everything for this.
Actually, I have created a Process builder on the Account which has created a Contact related to that Account whenever we create an Account.
When I am inserting 5000 accounts by execute anonymous window it is not executed and showing below error.
Can anyone please help me with this, It will be really helpful for me. Thanks!
"FATAL_ERROR|System.DmlException: Insert failed. First exception on row 2400; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Contact related Account” process failed. Give your Salesforce admin these details. Limit Exceeded
You or your organization has exceeded the maximum limit for this feature. Error ID: 1930279826-405699 (-1741830137)nization has exceeded the maximum limit for this feature. Error ID: 1930279826-405699 (-1741830137): []"
public class BulkAccountCreation {
public static void method(){
List <Account> accList = new List <Account>();
for(Integer i = 0;i<5000;i++){
Account acc = new Account ();
acc.Name = 'Takashi';
accList.add(acc);
}
insert accList;
for(Account account:accList){
System.debug('Account Name:::'+account.Name);
System.debug('Contact Name:::'+account.contacts);
}
}
}
Best Answer
It has been solved. I used batch class for this and it worked for me.
Invoking Batch class -
Thanks Derek F and sfdcfox for your quick responses.