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.

Next and Previous Links

Featured Replies

  • Newbies

FX had convenient Next and Previous links that arranged all name value pairs and could be invoked by:

<?php echo $SearchResult['linkPrevious'];?>">PREVIOUS

<?php echo $SearchResult['linkNext'];?>">Next

Does the FM API have an equivalent?

Not really but it would be easy enough to grab. The Filemaker_Result object returns the records in a zero based numerically indexed array so all you have to do is use




/*where $FMResult is your Filemaker_Result object*/

$last = $FMResult->getFetchCount() - 1;

$FMRecords = $FMResult->getRecords();

foreach ($FMRecords as $key => $rec){

  /* $key will be set to the array key 

  so $key - 1 is the previous record in the array 

 and $key + 1 is the next record in the array

 don't forget check that you don't go off either end of the array */

$prev = $key > 0?$key - 1:0; 

$next = $key < $last?$key + 1:$last; 

 /* $rec will be set to the Filemaker_Record object.

$FMRecords['$prev'] will grab the previous record object

$FMRecords['$next'] will grab the next record object */

}

?>

you could session the $FMResult object and grab it when the page refreshes. This would have the advantage of reducing calls to the db thereby speeding up load times but you wouldn't get new data until you closed your session (i.e. completely quit your browser). If you choose to reload the $FMResult from the db on each refresh you'll need to make sure to pass a unique ID and loop through all records in your found set until you see it.

I'd advocate a third path of not sessioning the Object, and using AJAX and JSON to build, display, and scroll through your single record "Form" without refreshing the web page. It's getting into more "advanced" web programming, but with a little practice it's not that hard to pick up.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.