function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GlennWGlennW 

Strange error on query

I've had this happen 3 times but I can't seem to ever replicate the error.  It occurs on pulls of a large number of records from salesforce via a Query (and queryMore) call.  The number of records returned is less (it has always been by 1) then then .size attribute on the QueryResult object.

In other words the .size may be 12000 but the .records contains only 11999 sobjects

Has anyone else run into this problem or is it a known problem?  I'm guessing that it could be caused by an object being deleted during the query process and the .size not being updated.

GlennW
www.demandtools.com

Message Edited by GlennW on 05-24-2004 03:18 PM

MilkovicMilkovic
I have had this happen, but it always seems to pick up the one it missed on the next querymore so I never worried about it.
rchoi21rchoi21
The case you've explained is easily possible with a delete after the initial query. The initial query call calculates the size of the entire query (records returned by query and queryMore) once, and returns that value. That value only reflects the number of rows that matched that query at the time the query was issued; it does not reflect any subsequent deletes or additions that fit the query criteria thereafter.