2 Replies Latest reply on Feb 1, 2013 12:39 PM by MelJackson

    Using Fields as Buttons



      Using Fields as Buttons


           I'm using a field as a button but can't figure out how to capture which field was clicked on.  I was sure it would be a GET funciton and thought for sure get(ActiveFieldName) would do it but when you click on a field as a button, the field has no focus.  Then I thought, I'll just use a gotofield script step to give it the focus but I don't know which one they clicked on!

           Any ideas would be greatly appreciated.


        • 1. Re: Using Fields as Buttons

               You can't use a get function because, oddly enough, clicking a button does not give that button the focus. And you can't click a field formatted as a button to put the cursor into the field--the only way that a field can become the "active field".

               But you can use the script parameter box for the button to pass the fieldname or the field's contents as a script parameter.

               When passing a field's name as a script parameter, I recommend using the GetFieldName function:

               GetFieldName (YourTable::yourField)

               This seems more complex than simpley using: "YourTable::YourFIeld", but using GetFieldName like this insures that if you later go to Manage | database | Fields and change the name of the field, your button will still pass the corrrect field name to the script.

          • 2. Re: Using Fields as Buttons

                 It's been a few years since I've played with FM.  Don't know why I didn't think of that but I'm sure glad YOU DID!! 
                 Works like a charm!!

                 Thanks a million!