anita hamis Posted January 29, 2002 Posted January 29, 2002 Hi all, I would like to make it possible to view the most recent records in a portal ,say for the past three days,and the portal to be updating itself as the days go by. i've tried doing this using a script but am not getting succesful. i dont want to use a find Because that would mean a user being able to say show all. any ideas? anita
danjacoby Posted January 29, 2002 Posted January 29, 2002 Have a CreationDate field in the related file (a date field that auto-enters the creation date), and set the relationship up to sort by that field in descending order. That way, you'll see the most recent records at the top of the portal.
anita hamis Posted January 29, 2002 Author Posted January 29, 2002 Thanks Dan, that was a quick reply. That worked fine but what if i only wanted to view records for the past 3 days..can i put a calculation in the creation date field based on just the 3days, so the portal doesnt show records that are not within that. anita
mun Posted January 29, 2002 Posted January 29, 2002 How about setting a calculation field that says something like - TodaysDate = Today Then set another calculation field to be ThreeDaysAgo = Date(Month(TodaysDate), Day(TodaysDate)-3, Year(TodaysDate)) These values will update every time you open the database or change a field in that record. After that, create a script that will find in the range of ThreeDaysAgo ... TodaysDate Just preset that into a script, or else just have the script enter that range into your actual date field. I hope this helps.
mun Posted January 29, 2002 Posted January 29, 2002 Sorry that was for a script in which you perform a find into a list view. Actually, I thought of something - It will still require for you to do the find above using a script, but first create a field like DateRange and use that to determine whether or not you will show the data in the portal. Have the script reset all DateRange to "No" and then with whatever you find, have the script change the DateRange to "Yes". Create a portal that will relate to that set of files to a static field with value "Yes". The portal will then show only those dates.
mun Posted January 29, 2002 Posted January 29, 2002 Sorry that was for a script in which you perform a find into a list view. Actually, I thought of something - It will still require for you to do the find above using a script, but first create a field like DateRange and use that to determine whether or not you will show the data in the portal. Have the script reset all DateRange to "No" and then with whatever you find, have the script change the DateRange to "Yes". Create a portal that will relate to that set of files to a static field with value "Yes". The portal will then show only those dates.
anita hamis Posted January 30, 2002 Author Posted January 30, 2002 Thanks Mun, Everything worked except the second bit( getting the portal to strictly show records for the past 3 days) Am not sure, maybe i didnt do it perfectly well. Could you explain further probably with an example? anita.
The Bridge Posted January 30, 2002 Posted January 30, 2002 danjacoby put you on the right track. To see records from the past three days in your portal, make the primary key for the relationship a calculation field (text result) like so: Date_Primary_Key= code: Date(Month(Date_Field), Day(Date_Field), Year(Date_Field)) & "
The Bridge Posted January 30, 2002 Posted January 30, 2002 I wish I could take the credit for this tip...
anita hamis Posted January 31, 2002 Author Posted January 31, 2002 Thanks guys. I did it fine i managed to use all your suggestions and everything is fine though i had to create a global field that held the 3 specific days. anita.
Recommended Posts
This topic is 8333 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 accountSign in
Already have an account? Sign in here.
Sign In Now