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

Validate a Day of the Week

Featured Replies

I have a database where the user chooses the week beginning on a Monday from a drop down calendar. There are other fields that then calculate the date for the other days of the week.

So if they choose Monday 4-1: Tuesday 4-2, Wednesday 4-3, etc. is automatically generated.

I'm trying to write a validation calculation that ensures that the date the user selects from the drop down calendar is a Monday. I'm not very familiar with the date functions so any help would be appreciated.

Well, you could validate by a calculation =

DayOfWeek ( SelectedDate ) = 2

But why not let them choose any day, then calculate the days in the week of the selected date? For example:

Sun = SelectedDate - DayOfWeek ( SelectedDate ) + 1 ;

Mon = SelectedDate - DayOfWeek ( SelectedDate ) + 2 ;

etc.

Note that this example assumes week starts on Sunday.

  • Author

It is setup that way because that is the way HR wants it and it is not worth arguing with them over.

I tried that calculation but it doesn't prevent you from choosing a non Monday and does not display my warning message when the user chooses a non Monday. The field type is set to date, I'm not sure why it's not working.

Did you put in the field's validation options?

  • Author

Yes, it is set to validated by calculation.

I don't know why it doesn't work for you, then. I hope you realize that validation by calculation occurs at record commit only.

  • Author

Actually I didn't know that. It does work, you just need to click outside the field first. Sorry, still a newb at this stuff.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.