Question

The only way I can see to get a total record count necessary for setting up some sort of pagination mechanism would be something like:

$fileMakerObj = new FileMaker( /* credentials redacted */ );  
$fc = $FileMakerObj->newFindCommand('someLayout');  

//Get max Record count for someLayout 
$fc->setRange(0,0);  
$result1 = $fc->execute();  
$maxRecords = $result1->getTableTotalCount();  
$fc->clearRange();  

//Window 0-100 of $maxRecords  
$fc->setRange(0,100);  
$page1 = $fc->execute();  
//Repeat as necessary  

Is there something I am missing, or is this the only solution?

Was it helpful?

Solution

One minor but important change:

if you set

$fc->setRange(0,0);

to get the RecordCount, you actually don's set a range and scan through the set. If you use

$fc->setRange(0,1);

instead, you only read one record. Then use

$result1->getTableRecordCount();

to get the record count in the unterlaying table or

$result1->getFoundSetCount();

for the count of the filtered records.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top