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.

problem with Status(CurrentRecordNumber) and CDML

Featured Replies

i have a field in my database that is a calculation. it calculates the records number in the current found set by using the Status(CurrentRecordNumber) function. it is set to not store the result and calculate as needed.

on a results page on my website this field is displayed along with other information. it works perfectly when i only have one search parameter. however, when i have more than one search parameter it appears to still number the results as if i was only searching by the first parameter.

in other words, my results should also show 1, 2, 3, 4, 5, 6 etc.,

but instead these are results are showing something similar to 4,23,25,32,43,57

the strange thing is, when i go and look at the database where it is being hosted, the correct values appear for each record. but through the web i get the bizarre ones. any thoughts?

How would you go using [FMP-CurrentRecordNumber] ?

All the best.

Garry

Can't say off-hand what the problem is with the calculation, but if all you need is to number the records in your found set from 1...n, then use the [FMP-CurrentRecordNumber] tag.

  • Author

unfortunately, numbering is not all i need to do. i left details out for simplicity sake. but here goes:

i'm trying to get my results to wrap after each 3rd item. to do this i have a calculation field that generates one piece of html if the current record number is mod3 and a different piece if the current record number is not mod3.

that is why i cannot use [FMP-CurrentRecordNumber]

i'm reading on different ways to achieve this "wrapping" thing, but as i've already built it using this method and what i've done SHOULD work, i was hoping someone may have encountered this problem before and tell me how to fix it. thanks,

tim.

quote from other topic from me:

did you make sure the field isn't stored (see store options below the calculation)

  • Author

yup. i did. and as i said above, the calculation shows correctly on the database, but not through the web. i have since used a javascript solution to this problem, but it still seems worth looking into. i know that you've used this particular solution before, did you not have these problems with it?

I used a similar thing with row colors and that one does work oke.

what language version of filemaker are you using? english?

Try this:

<table><tr>

<script>i = 1 ; nCols = 3 ;[FMP-Record]

if ((i % nCols) == 0)

{ document.write("<td>[FMP-CurrentRecordNumber] [FMP-Field:name]</td></tr><tr>") ; }

else

{ document.write("<td>[FMP-CurrentRecordNumber] [FMP-Field:name]</td>") ; } ;

i++ ;[/FMP-Record]

</script></tr></table>


or you could try this:
<table><tr>

<script>i = 1 ; nCols = 3 ;[FMP-Record]

if ((i % nCols) == 0)

{ document.write("<td>" + i + " [FMP-Field:name]</td></tr><tr>") ; }

else

{ document.write("<td>" + i + " [FMP-Field:name]</td>") ; } ;

i++ ;[/FMP-Record]

</script></tr></table>


Hope this helps.

Garry

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.