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.

Get ( CurrentDate ) - don't update

Featured Replies

  • Newbies

Hello,

The "Get ( CurrentDate )" function I used in a calculation field should force to change the result (the date !) of that field when a certain date is achieved. But it doesn't do that. Is this normal or a malfunction ?

We don't have the old "Today" function ... so I have to use a script to get to. Is this correct ?

Any help would be appreciated! Thanks.

(FMP 7 & MacOS X 10.3.4)

Gil

If Get(Current System Date) doesn't update, you have probably chosen to store the calculation (or it is forced to be stored, because it is used for a relationship). If you can't unstore the calculation, you could integrate an update mechanism in the start script for your file:

SetField(DateFieldForTrigger; Get (System date))

and use "DateFieldForTrigger" in the calculation instead of Get (System Date).

  • Author
  • Newbies

Detlev Bruggmann: You are right ! Here is the situation:

Case (

DayOfWeek ( Get ( CurrentDate ) ) = 1 ; Field1 ;

DayOfWeek ( Get ( CurrentDate ) ) = 2 ; Field2 ; (...)

To make this work properly, everyday, I must to check the option "Do not store calculation result - recalculate when needed" ... I forget that little thing.

I'm going to see tomorrow - when the date changes - if this is confirmed.

Thanks anyway,

Gil

You can change the date setting on your computer to test this today smile.gif

  • 3 weeks later...

I'm working on a db right now that uses get(currentdate) to calculate "days overdue" (A). With a global field for "days notice before due" (: and a relationship where A<B, I can make a portal showing nearly overdue and overdue events. In other words, B says "show me records in field A less than 5 days pending". This works, but only when (A) is indexed, so the get(currentdate) glitch appears.

Bruggmann's otherwise elegant "SetField(DateFieldForTrigger; Get (currentdate))" solution breaks indexing, and thus the above relationship, since the trigger is a global. The calc I use for the relationship lookup is unstorable, and complains that it "... cannot be stored or indexed because it references a related field, ..., or a field with global storage."

There MUST be some way to do this!

How do you create relationships based on date-sensitive calculations?

Curiouser and curiouser...

n1k0

Try turning it around, use your globals on the left side of you relationship.Sample file enclosed.

DateRangePortal.zip

It appears to work! G_CurrentDate was stored, but unlike my attempt, yours still worked when I unstored it. Thanks for the unexpected answer!

Much gratitude,

n

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.