MikeAz Posted May 20, 2008 Share Posted May 20, 2008 I have created a calculation to auto-enter data based on a valid until date being compared to the current date (see previous post here) I’m now concerned that the data will only change on the date the valid until field’s data is entered (please let me know if I am mistaken). How do I ensure that this data is updated every time that the database is opened? I assume that I’ll need a startup script, however I have no ideas about how to go about this. Any suggestions would be appreciated. Thanks Mike Link to comment Share on other sites More sharing options...
AHunter3 Posted May 21, 2008 Share Posted May 21, 2008 Change it from an auto-enter calc TEXT field to an actual CALCULATION FIELD of result type "text", and set the storage to "unstored" so it will get a fresh current value for Get(CurrentDate) each time the field is needed. NOTE: you cannot index such a field. If you need this field to be indexed, this will not work. Link to comment Share on other sites More sharing options...
MikeAz Posted May 21, 2008 Author Share Posted May 21, 2008 Thankyou for your help, this works great for the "Current" and "Outdated" entries, however the "Deleted" entries show as "Outdated" when the ValidUntil field is left blank. I guess this is because the Date Value when left blank is less than the current date. Is there anyway to fix this so that the IsEmpty calculation will work? I have created a button to add "Deleted" into the ProductStatus field, but this will not work anymore as we no longer allow changes to be made to this field (or any data to be stored). Thankyou for all your help already Mike Link to comment Share on other sites More sharing options...
LingoJango Posted May 21, 2008 Share Posted May 21, 2008 Change the order of the Case statement: first, test for IsEmpty, then for the other two conditions. Link to comment Share on other sites More sharing options...
MikeAz Posted May 21, 2008 Author Share Posted May 21, 2008 Thankyou again (and for such a swift reply). You FileMaker Forum people are being too kind to me! Kind regards, Mike Link to comment Share on other sites More sharing options...
Recommended Posts