This Error is getting at line 63
global class Integration {
global class AllObjects {
webservice string aName;
webservice string aNum;
webservice string cName
}
global class Return {
webservice string raName;
}
webservice static List<Return> Allobjectsmethod(List<AllObjects> a1List) {
List<Account> accounts = new List<Account>();
List<Contact> contacts = new List<Contact>();
List<Return> returns = new List<Return);
for(AllObjects a1 : a1List)
{
Account a = new Account();
a.Name = a1.aName;
a.Number = a1.aNum;
accounts.add(a);
Contact c = new Contact();
c.Name = a1.cName;
contacts.add(c);
Return r = new Return();
r.raName = a.Name;
results.add(r);
}
// Bulk insert accounts
insert accounts;
// Assign contacts to accounts
**for(Integer rowIdx = 0; rowIdx < accounts.size(); rowIdx++)** // error occur point
contacts[rowIdx].AccountId = accounts[rowIdx].Id;
// Bulk insert contacts
insert contacts;
return returns;
}