Jana Posted June 30, 2005 Posted June 30, 2005 Hey...I'd like to create a field that will show a timestamp that is updated only when the user manully pushes a scripted button. In others words, I want the user to be able to control when the timestamp should be update based on the fact that only certain fields on a layout have been changed. Any suggestions how to create that field and corresponding script? thanks
Reed Posted July 1, 2005 Posted July 1, 2005 Any timestamp field will do... Set Field [timeStampFieldName; Get (CurrentTimeStamp)] #This one step script attatched to a button If you actually want a timestamp field to automatically change when other fields are changed, just put an auto-enter calculation in the timestamp field definition that uses the Evaluate() function. Evaluate (Get(CurrentTimeStamp);[field1;field2....fieldn]) The field list in brackets are the fields that will trigger the timestamp update. You don't need a button to be pressed or any script to make that work. Just make sure you uncheck the "Do not replace existing values..." checkbox next to the AutoEnter calculation dialog. Dana
Jana Posted July 1, 2005 Author Posted July 1, 2005 Great! Thanks, I get what your saying but I can't duplicate your calculation. There is not a Get(CurrentTimeStamp) in the list of functions. I see GetAs(Timestamp) or Get(flag) but haven't been able to successfully create the calculation without getting an error message. Can you help Also, using the Evaluate calculation, can I tell it to evaluate all except one or two fields without listing all of the 40 fields? thanks
Fenton Posted July 1, 2005 Posted July 1, 2005 There is a Get(CurrentTimeStamp). You're not looking in the Get functions section. As to the other question, I could be wrong, but I think you have to list the fields. Use the FieldNames function (Design functions) to get them off of a layout. Then use a text editor (TextWrangler) to add the commas.
-Queue- Posted July 1, 2005 Posted July 1, 2005 You don't need Evaluate for this, actually. If( field1 and field2 and ... and fieldn; Get(CurrentTimeStamp); Get(CurrentTimeStamp) ) will work fine. Make it auto-enter with 'do not replace existing value' deselected and 'do not evaluate if all referenced fields are empty' deselected if you want it to update when all the fields are cleared. I think you may be having issues with Dana's calc because it requires quotes around Get(CurrentTimeStamp).
Recommended Posts
This topic is 7169 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now