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.

How to Log Date when a Checkbox was checked

Featured Replies

  • Newbies

Haven't figured how to record the date in a date field when someone clicked the checkbox "on:"

For the sake of argument lets assume you want the checkbox to set the Date field to the current date. Create a Value List named something like SetCurrentDate with the only value being "Y" (without the quotes). Next create a script called SetCurrentDate:

If [MyTable::MyCheckBox ; "Y"]

-Set Field[MyTable::MyCheckBox ; ""]

-Set Field[MyTable::MyDate ; ""]

Else

- Set Field[MyTable::MyCheckBox ; "Y"]

- Set Field[MyTable::MyDate ; Get(CurrentDate)]

End If

Then set the Field Format for you checkbox to "Check Box Set", Display Values from SetCurrentDate. Set your checkbox field to a button to perform script SetCurrentDate.

*Edit: I re-read your post and maybe you want this value stored in a related table to track all changes to the checkbox?

Make your date field an auto-enter calc with the following calc:

Case (not IsEmpty (your checkbox field) ; Get (Currentdate) )

This will always enter the date when someone checks the checkbox. When they uncheck it, it removes the date.

Right, never even thought about the auto-enter calc. A little more straight forward might be - If(IsEmpty(CheckBox);"";Get(CurrentDate))

If(IsEmpty(CheckBox);"";Get(CurrentDate))

You don't need the null result with vs. 7.

We don't know what the checkbox 'on' represents. It might be a 1 toggle. I always have a 'Select' value list which simply contains a 1 so I can use the same value list for many on/off toggles on fields.

If using a 1, all you need is:

If(Checkbox; Get(CurrentDate))

On that Auto-Enter calculation - if you want the current date to appear when checked but disappear when unchecked, you must remember to unclick the checkbox below the Auto-Enter by Calculation that says, "Do Not Replace Existing Value." If you want the date last checked to remain, leave this clicked.

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.