Filtering Portal Record by Most Recent
Is there a way to filter portal records by - say the six most recent? So that the newest, (say seventh) will remove the sixth from view?
Thanks for any help!
Set up a six row porta, no scroll bar and specify that it sort records by a date or auto-entered serial number in descending order. Then the 6 most recently created records will occupy the top six rows in your portal.
the only problem with that is that I can not add any new records without it deleting previous ones. ... is there a button to add a related portal row? i can see to add a new record, but that's not what i'm trying to do...
Yes, when sorting portals to put the newest record first, one frequently uses a button and a script. The script looks like this, but substitute you names for the place holders in the example script:
Set Variable [$ID ; value: LayoutTableOccurrence::PrimaryKey ]
Go to Layout [ "PortalTableOccurrence" (PortalTableOccurrence) ]
Set Field [PortalTableOccurrence::ForeighKey ; $ID ]
Go To Layout [original layout]
THis script assumes that your relationship for the portal is: LayoutTableOccurrence::PrimaryKey = PortalTableOccurrence::ForeignKey.
Be careful about script triggers specified on either of the two layouts as the change in layouts can trip a number of script triggers and the script they perform pops up in the middle of the above script and this can interfere with your results.
great! thank you so much!
Retrieving data ...