3 Replies Latest reply on Nov 21, 2011 9:03 AM by philmodjunk

    Dynamic "invisible" fields

    MikeF

      Title

      Dynamic "invisible" fields

      Post

       

      On a layout in form view, is there any way to make a field invisible -- or visible -- only if criteria in another field is met?

      Example:

      IF [fieldCurrency] = "USD",  myField is invisible, otherwise it's visible

      Any assistance will be greatly appreciated.

      Thanks,

        Mike

       

        • 1. Re: Dynamic "invisible" fields
          philmodjunk

          Select MyField while in layout mode and give it this conditional format expression:

          YourTable::fieldCurrency = "USD"

          Specify a font size of 500.

          This hides the data in the field, but field borders, if any will still be visible.

          If the field has visible borders that you also need to hide, please post back and I'll suggest some more sophisticated approaches that can hide the field when there are visible borders involved.

          • 2. Re: Dynamic "invisible" fields
            MikeF

             That does work, but it leaves the border in and fill color white.

            The fill color is easy to deal with in conditional formatting, but there's a pattern that isn't.

            Guess there's no "switch" that will make the entire field just plain invisible?

            Thanks,

              Mike

            • 3. Re: Dynamic "invisible" fields
              philmodjunk

              No, that's why I mentioned that limitation in my first post.

              I can think of two non-scripted methods to create an appearing disappearing border and several that rely on scripts that get performed by script triggers that will fully hide the field using some layout sleight of hand.

              Method 1. (I haven't tested this but am pretty confident it will work. Test it and let me know how it works out...)

              Add an extra field to your table. This can be an empty text field.

              Place it behind your field and make it two pixels taller and two pixels wider than your disappearing field. Use the behavior section in the Inspector's data tab to prohibit entry into this field. Remove the border property for your disappearing field. the field behind it will now use it's fill color to provide a border and since this is a fill color, conditional formatting can control whether the fill color is visible, matches the background or is transparent. (To get conditional format controlled transparent fill patterns, specify this pattern as the default pattern and use conditional format expressions to specify a fill color when you don't want the field to be transparent.)

              Method 2.

              Put the disappearing field inside a one row portal that has invisible portal borders. Use a self join relationship so that the field can still be part of the same data source table. Either a portal filter or the portal's relationship can control whether or not a related record is shown in the portal. If there's a related record, the field is visible. If no related record, no field is visible.

              Scripted methods:

              Scripted methods either change layouts, switching you between two copies of the same layout, one with the field and one without or they use Go To Object and an invisible tab control with two panels, one with the field and one without to hide/reveal the field.