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.

Finding Next 7 Day's Reservations (records) script

Featured Replies

This problem is baffling me, what am i doing wrong?

i want to find records of reservations for the next 7 days. Sometimes this works, sometimes it doesn't depending on the day, I don't know what's wrong... Is there a better way to do this?

If today is sunday the 14th, i want to find reservations beginning Monday the 15th to sunday the 21st

if I do this find on a Tuesday, i want to see records beginning on wednesday for 7 days etc.

My script is as follows:

Find Next 7 Day's Reservations

---------------------------

Allow User Abort [Off]

Set Error Capture [On]

Enter Find Mode []

Set Field [Clients::DateRequested; Let([ D = Get(CurrentDate); W = DayOfWeek(D)]; D - W + 1 & "..." & D + 7 - W )]

Perform Find []

Go To Layout ["Tours Booked Next 7 days Report" (Clients)]

Sort Records [Restore; No dialog]

If [not Get(FoundCount)]

Show Custom Dialog ["no records could be found.";"No records coould be found."]

Show All Records

End If

If anyone can spot my mistake, that would be great, also if anyone has any ways to jazz this up with a better custom dialog popup or anything cool, i am all ears..

thank you! Hope others find the script useful when it works..

Michael

You don't need the "W" in your calculation.

  • Author

Let([ D = Get(CurrentDate); W = DayOfWeek(D)]; D - W + 1 & "..." & D + 7 - W )]

would be???

Let([ D = Get(CurrentDate);]; D + 1 & "..." & D + 7)]

That can't be right?:(

Yes that is right.

If D = Current date then D + 1 = tommorrow and D + 7 = 7 days latter.

  • Author

Thank you Ralph! Your explanation clicked for me too. I understand it now...

Let( D = Get(CurrentDate); D + 1 & "..." & D + 7)

was just what I needed!

Create an account or sign in to comment

Important Information

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

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.