You need to sign in to do that
Don't have an account?
DMonster
System.IndexOutOfRangeException: Index was outside the bounds of the array.
The code below works fine using the development test account login. When I switch to the production login I get an error:
qr = objSF.queryAll("select Id, Name, OwnerId from Opportunity");
for(int i=0; i < qr.size; i++)
{
sObject account = qr.records[i];
Response.Write("<br><br>Opportunity Name: " + getFieldValue("Name", account.Any) + "<br>Owner: " + getFieldValue("OwnerId", account.Any) + "<br>ID: " + getFieldValue("Id", account.Any));
}
{
sObject account = qr.records[i];
Response.Write("<br><br>Opportunity Name: " + getFieldValue("Name", account.Any) + "<br>Owner: " + getFieldValue("OwnerId", account.Any) + "<br>ID: " + getFieldValue("Id", account.Any));
}
I get this error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
However, I just pull qr.records[5] or some other value it works. I noticed that using qr.records[qr.size] or qr.records[qr.size -1] also produces the error. It's like the size (qr.size) is not correct ; larger than it should be???
Any ideas? Again, works fine in development mode. Fails with production login.
Thanks.. I figured it out from the API docs... Guess I shoulda checked there first.
Thanks,