November 8, 200421 yr How do i? Portal to display First 100 records - Sorted by Date Desc, So i can get the latest records from the database. Currently I create a layout that will pull all the records, takes a long time. Thanks Thanks....
November 8, 200421 yr "Portal to display first 100 records so I can get at the latest records from the database". You want the first 100 but want to get at the latest date? The first 100 records in the database will probably be the oldest dates instead, right? I would suggest instead using globals to filter your portal. In vs. 7, we can join on more than one field; multi predicate. You would use greater-than and less-than with date globals (gFrom and gTo) joined to your one date - to display date ranges as you wish in the portal or use Custom Function Date Range or SmartRanges. Or you can use unstored date calculations, ie, Get(CurrentDate) - 90 and Get(CurrentDate). Then sort the relationship on your related date field or sort the portal itself.
November 8, 200421 yr MoonShadow: I think you're misreading Ivan's post. He wants to display the latest records, not the "first," but only 100 of them. One method would be to get the last record ID of the related table and then subtract 99 from that and set up a non-equijoin relationship with that range of records.
November 8, 200421 yr "record ID of the related table and then subtract 99" Hmmm, RecordIDs do not run in sequence by 1; in fact, they jump by large (and irregularly numbered) amounts. Your idea might only produce 3 records - or none. No, I didn't misunderstand him. If he has a serial, he could use that also. My point was that he asked for the 'first 100' when actually he wants the 'last 100.' No?
November 8, 200421 yr Apparently. The related records would be sorted by date in descending order; so it's a matter of picking off 100 of them.
November 9, 200421 yr Author How does one create a Non-equijoin relationship? How does one do a filter? Portal display the occurances of keyfield. I have also tried the limit records using permissions it supports boolean only? Thanks for help. I am new to Portal .
November 9, 200421 yr I think you would have to set a global with the 101st related record id (if it exists) and use a relationship of global > related::id. You would need a script like If [Count(yourrelationship::id) > 100] Go to Related Records [show, yourrelationship] Sort [ by date descending ] Go to Record/Request/Page [101] Set Field [originaltable::globalnumberfield; id] Commit Records/Requests Go to Layout [original] End If
Create an account or sign in to comment