Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi there - I am using the Filemaker php API to create a select menu and populate with options -

However, it also returns lots of empty values - where the field being used is empty.

How do I add an omit to the php ?

here is my current code - which does not work :


	$fm = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS);

	$find_lands =& $fm->newFindAllCommand('COUNTRIES');

//	$find_lands->addFindCriterion('COUNTRY', "=");

//	$find_lands->setOmit(true);	

	$find_lands->addSortRule('COUNTRY', 1, FILEMAKER_SORT_ASCEND);

	$result_lands = $find_lands->execute();

When I run that - I get Fatal error: Call to undefined method FileMaker_Command_FindAll::setOmit() in /Library/WebServer/Documents/project/includes/lands.php on line 14

With the two lines above commented out and using the FindAll it works but with the empty options

Any idea what I am doing wrong /

Many thanks in advance

Glorifindal

You've got a couple of problems. First, the FindAllCommand is only for finding all the records for the supplied layout. Second, the setOmit() function is only available for a compound find request which would look like this:


$cpdFind = $fm->newCompoundFindCommand($layout);

$req = $fm->newFindRequest($layout);

$req->addFindCriterion("COUNTRY", "=");

$req->setOmit(true);

$cpdFind->add(1, $req2);



$result = $cpdFind->execute();





however in my testing it seems there's a bug in the API that ignores the setOmit = true value if its the only request in the compound find i.e.  the above actually returns all records where COUNTRY == "" but the following works 



$cpdFind = $fm->newCompoundFindCommand($layout);

$req1 = $fm->newFindRequest($layout);

$req1->addFindCriterion("PrimaryKey", ">=0");

$req2 = $fm->newFindRequest($layout);

$req2->addFindCriterion("COUNTRY", "=");

$req2->setOmit(true);

$cpdFind->add(1, $req1);

$cpdFind->add(2, $req2);



$result = $cpdFind->execute();





However since all you want is a list of all records where "COUNTRY" is not empty the following would be the easier route





$find = $fm->newFindCommand($layout);

$find->addFindCriterion("COUNTRY", "*");



$result = $find->execute();

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.