signal Posted March 27, 2001 Posted March 27, 2001 I've got a little calendar database that I call with the click of a button that will allow me to select a date, then goes back to the original database and enters the selected date. I created a script that when you click a little icon, FM stores the field name and portal row in globals, opens the calendar, waits for the selection, then goes back, steps throught the fields until it gets to the one I was in when I clicked the icon and enters the date. Problem: I have many date fields and you have to be in a field to set the current field. It's just not very elegant. You should be able to click the button and it knows you mean the date field it is next to. Solution: Some smart FM type person can tell me how to select the field just left of the button using scripting.
LiveOak Posted March 27, 2001 Posted March 27, 2001 Instead of setting the global field with Status(CurrentFieldName) just set it (SetField(gFieldName, "DateField")! If you only have one button for multiple fields, use the Clairvoyance[] function to guess which field you want . -bd
SteveB Posted March 28, 2001 Posted March 28, 2001 I have approxiamtely the same problem...28 date fields on each of 8 different layouts. I wanted to pop up a calendar when the user clicked into one of these date fields. The only solution I could come up with is separate scripts (224 one line scripts using SetField wired to the calendar popup). Pretty kludgy? You bet!!! I've tried to come up with a better solution but I can't. This probably doesn't make you feel any better, but misery loves company.
LiveOak Posted March 28, 2001 Posted March 28, 2001 Steve is correct. There is no way I know of to detect the cursor position. You'll need one script for each field. The field unique scripts can be short and all call a common subscript after they set a global to Status(CurrentField). You can use your current approach for the returned data, going to the next field and testing against the field name. -bd
signal Posted March 28, 2001 Author Posted March 28, 2001 Well, I feel a little better. At least I only need one script regardless of how many different date fields I have. Guess I'll have to wait for FM 6.
signal Posted March 28, 2001 Author Posted March 28, 2001 Sorry, my FilterHumor[] function returned an error so I can't tell which part of your response was supposed to be funny. I have multiple date fields like datedue and dateentered inside a portal; so on one layout, I could have 25 possible date fields. Obviously, I don't want to write a script for each one. Also, I can just copy my button and put it anywhere which is pretty convenient since the script works as long as you push the button while the cursor is in a date field. My script works but I was hoping I could capture the fieldname of the field next to each button by referencing the (x,y) location of the button and subtracting 1/8 inch or something like that. Goofy I know, but certainly plausible. [ March 27, 2001: Message edited by: signal ]
Recommended Posts
This topic is 8646 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