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.

Going to next record in found set

Featured Replies

Hi

In my website I want to be able to add a link that allows the user to step through each record in a _found_ set (like the flip folder on the left in FileMaker). I've tried using

<a href="FMPro?-DB=jobs.fp5&-Format=jobdetail.htm&-Skip=1&-Max=1&-Find">Next Record</a>

  • Author

mindtpi99 said:

Hi

In my website I want to be able to add a link that allows the user to step through each record in a _found_ set (like the flip folder on the left in FileMaker). I've tried using

<a href="FMPro?-DB=jobs.fp5&-Format=jobdetail.htm&-Skip=1&-Max=1&-Find">Next Record</a>

But it steps through each record in the whole database - how do I constrain it to only step through each successive record in the found set only?

Thanks!!

Try this:

<a href="[FMP-Link:k]&-Skip=[FMP-CurrentRecordNumber]">Next Record</a>

I haven't tried it. However, it may be worth a go!

Good Luck.

Garry

  • Author

Garry Claridge said:

Try this:

<a href="[FMP-Link:k]&-Skip=[FMP-CurrentRecordNumber]">Next Record</a>

Does the same thing - but thanks for your suggestion

It will only step through all of the records if you do not use any find criteria. That is why you should use a [FMP-Link], it will include the original find criteria.

Good Luck.

Garry

Look in the Sample Files forum.

Is there a reason you don't want to use:

[FMP-linkprevious]Previous record[/FMP-linkprevious]

[FMP-linknext]Next record[/FMP-linknext]

On the page that creates the found set, I have

<input type="hidden" name="-Max" value="1">

allowing users to flip through each record page one at a time.

Ernie

  • Author

ErnieG said:

Is there a reason you don't want to use:

[FMP-linkprevious]Previous record[/FMP-linkprevious]

[FMP-linknext]Next record[/FMP-linknext]

Yes, what I want is to display the entire found set as a list and, when the person goes to the detail view page, they can flip through the records that way. I take it from your post that you search for data it displays the results one record at a time rather than as a complete list first?

thanks for your suggestion tho...

Howdy! Here's a COPY/PASTE of an article I stashed away in my personal notes db. Hope it helps! --ST

http://www.filemaker.com/ti/106538.html

CDML Record Navigation with FMP Link Tag

------------------------------------------------------------------------

This article assumes that you have at least a basic knowledge of CDML, HTML, and creating FileMaker calculation fields.

CDML provides many useful tags that make navigating through a found set of records (commonly referred to as a "hit list") easier. Through the combination of -max,-skip and FMP-LinkPrevious and FMP-LinkNext tags, the computer can return subsets of the hit list with previous and next links on each page rather than the entire found set on a single page. If you have a found set of more than 100 records, it's easy to understand how having the ability to segment the found set is necessary.

But what if you want to take this a step further and provide previous and next links between each individual detail page? There are a few different ways to do this, but most of them involve some complex combination of frames and Javascript. The following solution is a much more elegant method that involves the creation of one additional calculation field and one of the most powerful CDML tags, FMP-Link. Here's how it's done:

First define the following calculation field:

Recordskip(Number result, Unstored):

Status(CurrentRecordNumber) - 1

This field must be placed on the layout that will be called by the "-lay" tag on your search page. It is also pertinent that it be defined as an unstored calculation. To define the calculation as unstored, click on the Storage Options button on the lower right hand corner of the Specify Calculation dialog box. Then, check "Do Not Store Calculation Results - Calculate only when needed." The purpose of this calculation is explained below.

The initial search page that you've created does not need to be changed at all. The only concern here is, as specified above, that the layout specified with "-lay" contains the unstored calculation field described above. The BODY of your format or results page should now contain something like the example below:

<TABLE>

[FMP-Record]

<TR>

<TD><A HREF="[FMP-Link:rmk]&-format=detail.html&-skip=[FMP-Field:Recordskip]&-max=1">[FMP-Field:Field1]</A></TD>

</TR>

<TR>

<TD>[FMP-Field:Field2]</TD>

</TR>

[/FMP-Record]

</TABLE>

<P>

[FMP-LinkPrevious]Previous[/FMP-LinkPrevious]

[FMP-LinkNext]Next[/FMP-LinkNext]

Notice that this format page does not use FMP-LinkRecID, the usual method of linking to a record detail page. FMP-LinkRecID is not necessary in this case, since the individual record ID, which is required for performing detail page operations such as editing, duplicating or deleting a record, is also passed to the detail page using FMP-Link.

FMP-Link (described in more detail in the CDML Reference database) is a powerful CDML tag that allows you to specify as a parameter one or more key letters. Each of these letters represents an omitted portion of the current page's URL. For this solution, three key letters must be specified: "r" which represents the current "-format" page; "m' which represents the current "-max"; and "k" which represents the current "-skip". Once these parts are omitted, they can be replaced using regular CDML URL syntax. The new format page should be your detail page, the max should be "1", since the detail page needs to show individual records, and the skip should be set to the field value of the calculation described above. The skip needs to be replaced because its value is different for every record in the found set. This is why the above calculation must be unstored. When there is a new found set, the calculation field is reevaluated and the data is sent to the web companion. The beauty of this solution is that once it is sent to the web companion and to the client browser, it is a hard coded link. There is no danger of another browser request altering any part of that link including the -skip.

The body of the detail page should look something like the following:

[fmp-if:currentaction.neq.find]

You have modified the record successfully!<P>

<a href="the_search.html">New Search</a> | <a href="[fmp-currenttoken: URL]&-max=25&-format=the_result.html&-find">Back to Hitlist</a>

[fmp-else]

<form action="fmpro">

<input type="hidden" name="-db" value="countries">

<input type="hidden" name="-RecID" value="[fmp-currentrecid]">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-token" value="[fmp-link:rsmta]">

<input type="hidden" name="-format" value="the_detail.html">

<input type="text" name="country" value="[fmp-field:country]"><BR>

<input type="submit" name="-edit" value="edit">

<input type="submit" name="-dup" value="duplicate">

<input type="submit" name="-delete" value="delete">

[fmp-currentrecid]

</form>

<a href="the_search.html">new search</a> | <a

href="[fmp-link:krm]&-format=the_result.html&-max=25">

Back to Hitlist</a> | [fmp-linknext]next[/fmp-linknext] |

[fmp-linkprevious]previous[/fmp-linkprevious]

[/fmp-if]

This example detail page is fairly complicated since it is used to perform deleting, duplicating and editing. Because the skip and max parts of the link were modified on the previous page, fmp-linkprevious and fmp-linknext can be used for the previous and next links. Also included is a "Back to Hitlist" link. This is optional, of course, but if a "Back to Hitlist" link is not provided, the browser's back button will have to be clicked many times if you have navigated through the previous and next links.

FMP-Link, this time with the action modified to "find", can also be set as a token, so that if an action on a detail page has been carried out, the token can be passed to a "Back to Hitlist" on the resulting format page.

Thanks for passing that along, Steve. Now I've stashed it away for myself.

You're right about your assumption, mindtpi99, and I missed that you wanted to carry the found set from list to detail page. I probably just have an easier-to-handle situation. For what it's worth, I give the user a choice, at first, of viewing the find results as a list or single detail pages. But when they go to the list view, they see key identifying fields, which they can of course scroll. In the list, each line contains a link to open that record as a detail page IN A NEW WINDOW. Thus they can view/edit the details, then simply close the window to return to the list, keep scrolling to find the next record they're interested in, and open it in another new window.

That's what worked for me, anyway.

Ernie

Hi, Unable! Nope, never touched it. It may even be from the FMP4 days but it rang a bell when they were talking about it so I just plopped it out there hoping it could be useful. It's almost exactly what was asked for. I haven't read it for a long time but I got it because I thought it could help me someday... (I snatched it when I was trying to teach myself CDML... LOL! I'm still learning!)

Haven't gotten around to any of the samples files in FMFORUMS yet but I hope to browse/contribute someday.

--ST

  • Author

Thanks for everyones help - I'll read through the suggestions and see if I can sort something out!!

Seeing the above response from mindtpi99 reminds me of what Steve wrote in response to my query if he had ever tried the tag, "Nope, never touched it."

But Steve, if you have not tried the tag as you say, which must mean that you don't know how it works, whatever would make you think that "It's almost exactly what was asked for."?

Hi, Unable! mindtpi99 said :

"Yes, what I want is to display the entire found set as a list and, when the person goes to the detail view page, they can flip through the records that way."

The article I posted is about having a found set "hitlist" and then being able to navigate record-by-record from the detail page... sounds the same to me, at least. I never wanted this kind of thing in any of my solutions so never bothered trying it out. Help was asked for; I offered what I could.

--ST

mindtpi99's problem is at the point he selects a record to view, he then loses his search criteria. Hence, he then cannot "walk" through the "Found Set".

He will need to devise a method of retaining the search criteria. Tokens may be the means of achieving this!

A mere mental challenge wink.gif

All the best.

Garry

re: A mere mental challenge laugh.gif

Yes, which is why I first suggested the Sample Files forum, and then provided a specific link.

That "hooplah.htm" file takes some of the challenge out of it frown.gif

Well done!

All the best.

Garry

That's what the hooplah is all about.

Thanks.

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.