You need to sign in to do that
Don't have an account?
Mahendra Kumar 26
Receiving an error message "Method does not exist or incorrect signature: void InsertBulkAccounts() from the type DMLUtility'
Hi Guys, I'm a newbie for Salesforce...
I'm trying to insert 200 Account record through Bulkification process...However I get the above message...I'm just practicing the below code...I'm unable to execute...please help....
Here is the code...
public class DMLUtility
{
Public Static void InsertBulkAccounts()
{
//Insert 200 Account records...Always use bulkification process...
List<Account> lstAccounts = new List<Account>();
for(integer counter = 1; counter <=200; counter ++)
{
//Create an account record..
Account acc = new Account();
acc.Name = 'Bulk Accounts - '+ counter;
acc.Rating = 'Hot';
acc.AnnualRevenue = 2000000;
acc.Industry = 'Finance';
acc.Type = 'Open - Direct';
acc.Ownership = 'Public';
acc.Site = '554544';
acc.CustomerPriority__c = 'high';
acc.Active__c = 'Yes';
//Add the record
lstAccounts.add(acc);
}
//Insert the collection of records....
if(! lstaccounts.isEmpty())
{
insert lstAccounts;
}
}
}
Thanks in advance
I'm trying to insert 200 Account record through Bulkification process...However I get the above message...I'm just practicing the below code...I'm unable to execute...please help....
Here is the code...
public class DMLUtility
{
Public Static void InsertBulkAccounts()
{
//Insert 200 Account records...Always use bulkification process...
List<Account> lstAccounts = new List<Account>();
for(integer counter = 1; counter <=200; counter ++)
{
//Create an account record..
Account acc = new Account();
acc.Name = 'Bulk Accounts - '+ counter;
acc.Rating = 'Hot';
acc.AnnualRevenue = 2000000;
acc.Industry = 'Finance';
acc.Type = 'Open - Direct';
acc.Ownership = 'Public';
acc.Site = '554544';
acc.CustomerPriority__c = 'high';
acc.Active__c = 'Yes';
//Add the record
lstAccounts.add(acc);
}
//Insert the collection of records....
if(! lstaccounts.isEmpty())
{
insert lstAccounts;
}
}
}
Thanks in advance
You have not mentioned how you are calling the method: InsertBulkAccounts. Since InsertBulkAccounts is a static method you should be able to execute that method with this snippet:
Thanks,
Harish
Yes, I'm using the above method to call.
Thanks in advance....