4 Replies Latest reply on Feb 16, 2011 10:08 AM by philmodjunk

    "Select/Perform" without specifying field name



      "Select/Perform" without specifying field name


      I am trying to create a generic button for use with container fields where we store artifacts.  (The button allows for different functionality for web access vs. client access) Since I do not want a custom script for each field I use this with, I am trying to keep the field name out of the script.  Instead, I pass the Object Name of the the container field as script parameter.  This almost works fine.  It allows me to duplicate the button anywhere I need it, change the script parameter name, and use a single script.  There is only one problem - I need to do a "select/perform" to get it to open the linked file in the container (I can use other methods, but they are uglier).  My understanding is that if you use the "Go to Field" step and check the "select/perform" checkbox without specifying a field name, it should do a "select/perform" on the current field (which I set by using "Go to Object").  This does not work to open the linked file.  It does work if I use "Go to Field"check "select/perform", and specify the field name, but since I can't specify the field name by calculation (would be nice feature) this defeats the whole idea of a generic script.

      Is there some other way to do a "select/perform" on the current field (simulate double-click to open linked file in a container field)?

        • 1. Re: "Select/Perform" without specifying field name

          Sounds like you are putting media files in the container. Select/perform does not open other file types.

          You might experiment with Open URL and Use GetField to access the contents of your container field as named in your script parameter. The Filepath of the file is stored in the container field and you can access it with a GetValue call to extract the correct line of the text. You'll need to manipulate this file path to get it into a format that works with URL, but it is at least theoretically possible to do.

          To see what data is really stored in a 'store by reference' container field, define a calculation field to return text and enter the name of your container field as its calculation expression. Then place this on your layout next to your container field, sized several lines of text tall. This way you can see the format of the FilePath in order to construct an expression to extract the text you need for your Open URL step.

          • 2. Re: "Select/Perform" without specifying field name

            Set Variable [ $path ; Value: GetValue ( Get ( ActiveFieldContents ) ; 2 ) ]
            Send Event [ "aevt" ; "odoc" ; $path ]

            but the Send Event script step isn't web compatible.

            • 3. Re: "Select/Perform" without specifying field name

              The containers only contain references to PDF files so those do open fine if you either double-click on the container field or if in a script you specify a "Go to Field [Select/perform; table::field].  I was just trying to find away around specifying the field name and from what I had read it sounded like going to the right field and then doing a "Go to Field [Select/perform]" should work, but it either doesn't or I have something wrong.  I have found work arounds similar to the solutions described above, but the "Go to Field [Select/perform]" seemed cleaner and less platform specific if it worked (and I can't really understand what it is for if it doesn't work this way).

              Thanks for the suggestions though.  Maybe FM12 will allow a "Go to Field" by calculation (or by variable) and this can be simpler.

              • 4. Re: "Select/Perform" without specifying field name

                Interesting, never realized that select/perform will open a PDF that way. That option actually serves a number of different purposes depending on the type of field specified. If this were a text field, it would select the entire contents of a the field so that the next keystroke would replace the contents of the field with new input--which was the original purpose of this step.