2 Replies Latest reply on Jan 26, 2014 9:10 AM by brianpatterson

    Using Get (flag) function



      Using Get (flag) function



           I am trying to save values from a layout in find mode as global values for a complex search option. I can write a separate trigger script for each layout object, but I want to simplify this by putting all searchable objects in one script.
           Depending on how I play with the parens (), I get a variety of error messages but they all boil down to that Get ( ActiveFieldName ) isn't a valid function. Can somebody give me help with this.
           If         Get ( ActiveFieldName ) = CONTACTS::First Name
                SetField (CONTACTS::gFN1) = CONTACTS::First Name
           Else if Get ( ActiveFieldName ) = CONTACTS::Last Name
                SetField(CONTACTS::gLN1) = CONTACTS::Last Name
           Else if Get ( ActiveFieldName ) = CONTACTS::First Name 2
                SetField(CONTACTS::gFN2) = CONTACTS::First Name 2
           Else if Get ( ActiveFieldName ) = CONTACTS::Last Name 2
                SetField(CONTACTS::gLN2) = CONTACTS::Last Name 2
           End If
           Thanks to PhilModJunk for the answer to my lat question, which got me moving down the right road.

        • 1. Re: Using Get (flag) function
               Looks like you need to look up Get ( ActiveFieldName ) in FileMaker help wink
               If [ Get ( ActiveFieldName ) = "First Name" ]
                    SetField [ CONTACTS::gFN1; CONTACTS::First Name ]
               Else if [ Get ( ActiveFieldName ) = "Last Name" ]
                    SetField [ CONTACTS::gLN1; CONTACTS::Last Name ]
               And so forth...
               Please note that these are script steps in the script editor and not a calculation inside the specify calculation dialog.
          • 2. Re: Using Get (flag) function

                 Thanks for your reply. I really appreciate your commitment to this work.

                 Using your code as an example, I'm sure I can get this to work today.

                 Two things that especially struck me, even more than the code sample, are the use of square brackets and the distinction between script steps and and calculation steps. I need some more time on script basics.