AnsweredAssumed Answered

FM php default find behaviour

Question asked by pdh on Aug 23, 2010
Latest reply on Dec 1, 2011 by ccrumley

Title

FM php default find behaviour

Your post

Can somebody tell me how a hange the default find behaviour when using php and FM server. If I create a find page using the wizard when a user clicks find without entering any find criteria onthe page Filemaker returns all the records in the database. What I want it to do is to fail to find anything. I'm guessing it can be changed in this part of the code but I don't know what to change t to.

 switch ($action) {
       
        case "find": {
        // clear the recid
           $cgi->clear('recid');

        // create a find command
           $findCommand = $fm->newFindCommand($layoutName);
           ExitOnError($findCommand);

        // get the posted record data from the findrecords page
           $findrequestdata = $cgi->get('storedfindrequest');
           if (isset($findrequestdata)) {
               $findCom = prepareFindRequest($findrequestdata, $findCommand, $cgi);

            // set the logical operator
               $logicalOperator = $cgi->get('-lop');
               if (isset($logicalOperator)) {
                       $findCom->setLogicalOperator($logicalOperator);
               }
           } else
               $findCom = $fm->newFindAllCommand($layoutName);
           break;
        }
        default: {
           $findCom = & $fm->newFindAllCommand($layoutName);
           break;
        }
    }
    ExitOnError($findCom);

It looks like the default is a find all

$findCom = $fm->newFindAllCommand($layoutName);

is there a similar command to say find none ?

regards paul.

Outcomes