You need to sign in to do that
Don't have an account?
mikeol
Limit SF Data Connector to "count" records
Is there a way, particularly for testing, to limit the number of records returned by a query to the first "n" records (as well as the normal filtering such as field equals xxx)?
Many thanks.
Many thanks.
session.SetSoapHeader "QueryOptions", "batchSize", "1"
set qr = session.Query("select id from account",False)
'no need to look at any of the results
MsgBox qr.Size
'Be sure to set the batchSize back again after you finish
session.SetSoapHeader "QueryOptions", "batchSize", "2000"
Pardon my ignorance but where in SF Data Connector do I put the code suggested?:
session.SetSoapHeader "QueryOptions", "batchSize", "1"
set qr = session.Query("select id from account",False)
'no need to look at any of the results
MsgBox qr.Size
'Be sure to set the batchSize back again after you finish
session.SetSoapHeader "QueryOptions", "batchSize", "2000"
drawing row 23 of 322
or something, so you can see that this "count" or qr.size is fetched and displyed already.
search for :
Set queryData = salesforce.query("select id from " & g_objectType & " " & where)
in the query_draw() function, in module s_force
then you can get the "count" by inserting
msgbox queryData.size
strictly speaking you dont' need to set the batch size, that is a performance optimization.
I want to be able to set a universal numeric limit on top of the filter, e.g. 10 (effectively show me up to 10 of the records that match the filter). queryData.size is read only. What do I set to stop the retrieval and display process?
Thanks.
search for :
For Each ids In queryData
idlist(cnt) = ids.Item("Id").value
cnt = cnt + 1
[...blah, blah]
Next ids
---------
add one line after the cnt increment, to exit this For loop when you hit your number
if (cnt > 10) Then Exit For
i havent' tested this, but this is the code that draws the results row by row.