Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

portal records on specific days???

Featured Replies

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

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.

  • 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

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.

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.

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.

  • Author

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.

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

That is pretty cool - putting the "

I wish I could take the credit for this tip...

  • 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

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.