IF we call the units field CallBackUnits, and the number field callBackInterval, then this calculation will compute the call back date and time:
Case ( CallBackUnits = "Minutes" ; 60 * CallBackInterval + Get ( CurrentTimeStamp ) ;
CallBackUnits = "Hours" ; 3600 * CallBackInterval + Get ( CurrentTimeStamp ) ;
CallBackUnits = "Days" ; 86400 * callBackInterval + Get ( CurrentTimeStamp )
(Do not Call and a blank entry in CallBackUnits will return an empty result here.)
You can set this up for a timestampfield that is defined with an auto-enter calculation. If you keep "do not replace existing value..." selected for this field, you'll also be able to edit the field by entering any date or time you want.
You can get similar results by using a script trigger set on the drop down list and interval fields that uses set field to enter this timestamp into a timestamp field as well. The script trigger would allow you to enter a new timestamp each time you select a different value in units or enter a different interval where the auto-enter will only enter data if the field is already blank.
For your second request, you could use OnObjectEnter to perform a script that enters the current time stamp, but I recommend you enter this time stamp into its own field rather than into the text field. That way you can use this value as a date and time for searching and sorting which you can't do easily if it's entered as text into the text field.
Thank you, PhilModJunk. When I said remedial FM user, I meant VERY remedial. Therefore, I need a little bit more information to put your solution into practice.
1. It looks like what you've written is a field function. Correct? Or is it a script? (Or does this question make any sense?)
2. I'll need to research script trigger
3. Since I won't be searching or sorting the NOTES field I don't think I need a separate time stamp field. I will, however, have to figure out how to implement the OnObjectEnter (Field Function or Script?)
Thank you once again. I'll give it a shot.
1.) This is a calculation that you can implement two different ways to get the results you've specified. You can define a field of type timeStamp, select options, click the auto-enter tab and enter this expression as an auto-entered calculation. You can also use this expression as the parameter of a set field script step to enter the results of this calculation into a field of type timestamp. I've spelled out both options in my earlier post.
2) What version of FileMaker do you have? Not knowing that detail, I've made suggestions based on the assumption you are using FileMaker 11. Script triggers such as OnObjectEnter were a new feature introduced with FileMaker 10. If you are using an older version of FileMaker, you don't have that option available to you.
If you don't have script triggers as an option, you might put your notes field in a related table and use a portal to display it on your layout--even if you only want one notes field per record. If you do, you can use a relationship with "allow creation of records via this relationship" enabled so that entering text in the new field automatically creates the new related record. With that option, you could define a separate timestamp field that auto-enters the creation timestamp to get your date and time entered automatically at the moment you start entering your note.
Thank you again, PhilModJunk. I am using FM Pro 10. If this proves to be more than I can handle, do you have any interest in implementing this into a layout I've created that has everything else in place except for these two functions? I would be happy to discuss the details and costs further.
Click my "rainbow folder" forum avatar and send me a private message. We can discuss there.