I'm trying to return more than 2000 records, I haven't seen any answers for people using PHP and SOAP. Any recommendations? My query is simply:

      ID, Name


1 Answer 1


The SOAP API can return up to 2000 records at a time. If there are more records, then you will also be returned a QueryLocator which you can then use to do QueryMore call. You need to repeat the QueryMore multiple times until you get everything. See http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_querymore.htm

  • My problem is that it's pretty slow. I'm going through 135k contacts. It takes around 30 seconds which in browser time is an eternity
    – raygo
    May 13, 2014 at 16:09
  • Why do you need to retrieve so many contacts? Can you modify the query to get less records or implement pagination? May 13, 2014 at 16:20
  • 1
    can't imagine there's a useful UI that shows all 135k contacts in one go.
    – superfell
    May 13, 2014 at 16:21
  • What's your batch size? salesforce.com/us/developer/docs/api/Content/… might help you save on the roundtrips but your memory usage will go up because the incoming message will grow accordingly. Or read about Bulk API maybe?
    – eyescream
    May 13, 2014 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .