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.

What happened to TODAY?

Featured Replies

I am just getting to know v. 7. My first note of sadness came when I learned that they evidently did away with the TODAY function. They have a Get(current date) function but this does not seem to update (IOW, it gets the current date the first time it runs but does not update thereafter).

Why would the developers get rid of the TODAY function? I use it in a number of calculations.

What is the most elegant way of restoring this functionality?

Thanks,

Mark

Version: v7.x

Platform: Mac OS X Panther

Today is a leftover from old versions. You should convert all your Today calculations to use Get (CurrentDate) in FM7 and Status(CurrentDate) in FM6 & earlier.

Today does not function correctly in all situations, so your current calcs may be returning erroneous results.

> it gets the current date the first time it runs but does not update thereafter

Is the calculation containing the Get(CurrentDate) set to unstored? If it is stored, you may need to force a recalculation.

CyborgSam is right, it's gotta be unstored if you want it to update itself.. but before you do this, think really hard about what you're wanting to accomplish. If it's used in some sort of listview or calc with +100s of records, you're in for a wait while it calculates (just like the old time Today function).

With the new relationship power in FM7, you may find that you can do away with this need for a CurrentDate unstored function. I know I used to use it in a realtionship that would display a list of items that were less than X days old. Now, I can just write the relationships against the actual date in question instead of another calc field that was used to tell me how old the record was and then an automated find on that field (e.g. "<= 2" days old).

On conversion FM 7 will create a script to update your Today fields. It does this by creating another field, named "Today," regular date field. So, wherever you had "Today" in your calculations, it will now point to the "Today" field ('cause it's named the same). Pretty clever. Both the field and the script are commented. Take a look.

The script is fairly simple. It uses Replace. Personally I would change it to a Loop script, which behaves better in networked situations. You'd also want to be on a dedicated Form View layout when you run the script. I'd recommend some text on that layout telling people what's going on (in large files it can take a while). The date field must be on that layout, but can be hidden.

I haven't done this yet on 7, but I've done it on 6. I stopped using Today a while ago. The Loop is not really faster, about the same.

Another little kink, if you want to get serious, is that either Replace or Loop is going to mess with your modification date (I imagine, haven't tested on 7). I've created a little routine to protect it, using a separate Lookup field, and turning off the lookup temporarily.

Yes, I would concur with Bruce. Look hard at any other method to get your results. A stored Today field is an absolutely last resort. In most cases Finds can be rewritten, using Get(CurrentDate), or the new relationship capabilities using comparative operators may do what you need.

I ask myself that every single night....

I knew there was a rich vein of humor in this thread just waiting to be tapped... wink.gif

Yes. Agreed. Today was always a dodgy kludge.

Let's hope tomorrow will be better. laugh.gif

LOL! he he he... i just couldn't help myself!

Happy Birthday to you Singlequanta ! cool.gif

Version: v6.x

Platform: Mac OS 9

<<<BLUSH!!!>>>> Thank you ! LOL. This one snuck up on me!

Version: Developer v7

Platform: Windows XP

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.