Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help refining go to field script

Featured Replies

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.

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 wink.gif" border="0.

-bd

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.

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

  • Author

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.

  • Author

Sorry, my FilterHumor[] function returned an error so I can't tell which part of your response was supposed to be funny. wink.gif" border="0

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 ]

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.