Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Portal to display First 100 records - Sort by Date


This topic is 7320 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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....

Posted

"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? crazy.gif

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. wink.gif

Posted

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.

Posted

"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? wink.gif

Posted

Apparently. The related records would be sorted by date in descending order; so it's a matter of picking off 100 of them.

Posted

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 .

Posted

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

This topic is 7320 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.