June 18, 200421 yr 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
June 18, 200421 yr 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).
June 18, 200421 yr 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
July 4, 200421 yr 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
July 4, 200421 yr Try turning it around, use your globals on the left side of you relationship.Sample file enclosed. DateRangePortal.zip
July 4, 200421 yr 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