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

portal records on specific days???


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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

Thanks Mun,

smile.gif" border="0 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? crazy.gif" border="0

anita.

Posted

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)) & "

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