January 29, 200224 yr 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
January 29, 200224 yr 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.
January 29, 200224 yr Author 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
January 29, 200224 yr 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.
January 29, 200224 yr 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.
January 29, 200224 yr 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.
January 30, 200224 yr Author 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.
January 30, 200224 yr 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)) & "
January 31, 200224 yr Author 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.
Create an account or sign in to comment