Trying to Limit Subform to the last 3 records

eugenecjr

Member
I am trying to improve a forms load time by limiting the number of records displayed in the subform. I have tried several times using List --> Data --> Pre-Filters. Any advice would be greatly apprciated.

-Eugene
 
Juuser, have already been through the wiki several times. Everything is referencing dates , last 6 hours, last ? week. I am trying to limit to the last three records. I tried using the information provided and making alterations but nothing seems to work.
 
Ok, I seemed to miss the thread header and went straight to content :)

Cannot test, but something like:
field: id
condition: GREATER THAN
value: SELECT MAX(id) - 4 FROM yourtable
type: query

Or, if there can be deleted rows (missing id-s in between), then:
field: id
condition: IN
value: SELECT id FROM yourtable ORDER BY id DESC LIMIT 3
type: query
 
Last edited:
Jusser,

I was able to put in ‘the second option’ exactly as indicated with the appropriate table. Tested the SQL statement to verify before placing in Fabrik, and after saving the list does. It open Indicating an error with the statement.

I am wondering if this has to do with the other two pre-filters I have set. One is similar the this one with a different purpose of loading the list with specific records. This is working without issue. The pre-filter I am looking for is on the child records. Present after you open one of the parents.

In effect the purpose is to limit the number of records such to improve loading time.

The purpose of this form is to present records to the user that need to be inventoried. When they open each record a short list of the last few child records is shown for the last few inventory entries for the opened item. In the past I have tried using a filter the only show the last 2-3 weeks. The issue is for items that are missed for 2-3 weeks won’t have any records and therefore are removed from the list of items to be I be inventoried.

My main issue is performance.

I hope this helps shed a little light.

-Eugene


Sent from my iPhone using Tapatalk
 
Now my second post seems relevant again :). No idea what setup you have, other filters etc.

Does this prefilter work when you remove all others? Do you get more info about the error with &fabrikdebug=1 etc.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top