• David_FB
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

Hi all.

 

I'm trying to achieve pagination in a PHP application where I can query 20 rows at a time per page. The LIMIT keyword in the query is no use because there is no way to specify an offset (as you can with MySQL; LIMIT 0, 20).

 

I saw a few mentions of queryMore(), though with this, you are limited to a minimum of 200 rows, and you can't jump to a say the 3rd batch of results with this method. You have to iterate through all records, until you've called queryMore() the correct number of times.

 

 

$soql = 'SELECT Id, Name FROM Contact'; $sf->setQueryOptions(new QueryOptions(200)); $response = $sf->query($soql); // 1st page of results $queryResult = new QueryResult($response); $response = $sf->queryMore($queryResult->queryLocator); // 2nd page of results $queryResult = new QueryResult($response); $response = $sf->queryMore($queryResult->queryLocator); // 3rd page of results etc etc... $queryResult = new QueryResult($response);

 

 

 

 

Is there anyway to achieve pagination with results with a sensible limit? Of say 20 records?

Message Edited by David_FB on 05-11-2009 07:22 AM

I'm having an issue with 'fieldsToNull' and PHP Toolkit 13. I can't pass through an array of field names without getting this error:

 

$sObject->fieldsToNull = array('Current_Projects__c', 'About_Me__c');

 

Unexpected element {http://www.w3.org/2001/XMLSchema}string during simple type deserialization

 

Though, if I do:

 

$sObject->fieldsToNull = 'Current_Projects__c';

 

This will work fine, and set the field to null. But doesn't solve my problem of being able to set multiple field values to null.

 

Has anyone encountered this issue before?

Message Edited by David_FB on 03-10-2009 04:45 AM

I'm having an issue with 'fieldsToNull' and PHP Toolkit 13. I can't pass through an array of field names without getting this error:

 

$sObject->fieldsToNull = array('Current_Projects__c', 'About_Me__c');

 

Unexpected element {http://www.w3.org/2001/XMLSchema}string during simple type deserialization

 

Though, if I do:

 

$sObject->fieldsToNull = 'Current_Projects__c';

 

This will work fine, and set the field to null. But doesn't solve my problem of being able to set multiple field values to null.

 

Has anyone encountered this issue before?

Message Edited by David_FB on 03-10-2009 04:45 AM
Is it possible to use fieldsToNull with Perl?  I've only had success with using a sing

$elem->{fieldsToNull} = "BillingCity";

works.. but this

$elem->{fieldsToNull} = ["BillingCity", "BillingState"];

doesn't.  Is it possible to use multiple fields?

thanks

Jeremy