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

I need to display what I thought was a simple search result using CDML...Although I have pieced together a crude solution; how can I display the fields "record" "title" "countoftitle" as individual results while searching through the entire database? eg.

Total Found Count: 768

0051 How to Succeed in Business 23

0102 Business Plans 19

etc...

thanks.

Try the InLine tags.

This CDML in the format file will do it:

[FMP-CurrentFoundCount] records found.<br>

[FMP-Record]

[FMP-Field: record] [FMP-Field: title] [FMP-Field: countoftitle]<br>

[/FMP-Record]

OR

Is "countoftitle" a summary count of all of those titles found in the search? If so you may be able to use a Global field to achieve the summary.

All the best.

Garry

  • Author

thanks for your replies...

both inline and fmp-record work except for counting the number of records seperately or each occurance. each attempt i make at either summarizing or totaling the "count" field simply results in displaying "1" count for each record when there are different counts for each title:

current code

[fmp-inlineaction:-db=emailfriend.fp5,-lay=web,-max=25,-sortfield=record,-sort=descending,-token=fmp-field;title1,-find]

[fmp-record]

[fmp-field:record][fmp-field:title1] [fmp-field:count]<br>

[/fmp-record]

[/fmp-inlineaction]

what i'm i missing?...thanks.

Gregg,

Here is some Javascript I use for a similar effect. In this code I am tallying invoice amounts by company. The calling URL looks like this:

"http://......:1153/FMP?-db=invoices&-format=inv_list.html&-sortfield=inv_bus_id&-findall"

<script>

curr_bus_id = "blank" ;

inv_tot = 0 ;

[FMP-Record]

if (inv_tot == 0 ) {

curr_bus_id = "[FMP-Field: inv_bus_id]" ;

curr_bus_name = "[FMP-Field: inv_bus_name]" ;

inv_tot = [FMP-Field: inv_total_inc] ; }

else if ("[FMP-Field: inv_bus_id]" == curr_bus_id) { inv_tot += [FMP-Field: inv_total_inc] ; }

else {

document.write(curr_bus_name + " " + (inv_tot).toString() + "<br>") ;

curr_bus_id = "[FMP-Field: inv_bus_id]" ;

curr_bus_name = "[FMP-Field: inv_bus_name]" ;

inv_tot = [FMP-Field: inv_total_inc] ; }

[/FMP-Record]

document.write(curr_bus_name + " " + inv_tot + "<br>") ;

</script>

You should be able to substitute your fields. Hope this helps.

Garry

  • Author

thanks for replies...almost have it...

i used the java script which does exactly what i had intended from the beginning with one issue:

the results seem to display randomly even when i change the find and sort method in the URL...also, some duplicate and they do not list according to any -max settings (or any logical way that i can see)...

current code:

<script>

curr_bus_id = "blank" ;

inv_tot = 0 ;

[FMP-Record]

if (inv_tot == 0 ) {

curr_bus_id = "[fmp-field:record]" ;

curr_bus_name = "[fmp-field:title1]" ;

inv_tot = [fmp-field:count] ; }

else if ("[fmp-field:record]" == curr_bus_id) { inv_tot += [fmp-field:count] ; }

else {

document.write(curr_bus_id + " " + curr_bus_name + " " + (inv_tot).toString() + "<br>") ;

curr_bus_id = "[fmp-field:record]" ;

curr_bus_name = "[fmp-field:title1]" ;

inv_tot = [fmp-field:count] ; }

[/FMP-Record]

document.write(curr_bus_id + " " + curr_bus_name + " " + inv_tot + "<br>") ;

</script>

</td>

</tr>

</table>

<font size="2" face="arial, verdana">

[FMP-LINKPREVIOUS]

Previous

[/FMP-LINKPREVIOUS]  

[FMP-LINKNEXT]

More...

[/FMP-LINKNEXT] </font>

Try it with -max=all or no max at all. If it works OK that way (except for a long list) the paging is doing something to the ordering of the records.

I will try it with -max on my data later today.

All the best. Garry

  • Author

hello garry,

i tried -max=all and no max and fooled a bit with the sorts with no luck. did you have any success?

thanks.

Gregg,

My database has been sorting fine. Are you doing the sort on the 'record' field? How does the sort look in FM?

I can see a problem occuring if a page-break occurs part way through a particular title; i.e. that title will have a summary on one page and then on the next page. I don't have a solution for that yet!

If we can fix the sort problem first we can then solve the page break quandary.

All the best. 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.