4 Replies Latest reply on Jun 14, 2017 7:51 AM by philmodjunk

    Hiding container fields if other fields are empty

    eshute

      Hi, I have 5 container fields within a layout which will be available to the user to insert PDF documents into them. I want to set it up so that initially only the first container field is visible. If a PDF document is inserted in that field, I then want container field no 2 to display next to it and so on. How do I do this? When I enquired about hidden fields before, someone gave me a calculation of

       

      Case(

      Table::Field = "Yes"; 0;

      1

      )

       

      to hide a field which is dependant on field being marked as the values of yes or no but I cant figure out what to put if the field is empty?

       

      Hope this makes sense. Thank you.

        • 1. Re: Hiding container fields if other fields are empty
          erolst

          You only need

           

          IsEmpty ( Table::container )

           

          Note that

           

          If ( someExpressionIsTrue ; 1 ; 0 )

           

          is a redundant form, because that expression already is itself True or False, i.e. 1 or 0, and returns that value without the conditional clause.

           

          You may want to consider using a related table instead of numbered field. That would not only solve this problem by simply making it irrelevant (you create related records only on demand - what doesn't exist need not be hidden), but also other issues you may encounter down the road (meta data, reporting, aggregating ...)

          2 of 2 people found this helpful
          • 2. Re: Hiding container fields if other fields are empty
            eshute

            Ok great - thanks you. I will look into the related table idea.

             

            One more question about hiding things - I have a tab control which I am using on one of my layouts. Is it possible to hide one of the tabs on there is a specified field is empty?

             

            Thanks

            • 3. Re: Hiding container fields if other fields are empty
              erolst

              No ... but you could use a calculation to adapt the tab title, and use an object name and a script trigger (OnPanelSwitch) to prevent users from entering the tab "If ..."

               

              And possibly there is a totally different approach, but we coulnd't tell from just the fact that you have a tab control ...

              • 4. Re: Hiding container fields if other fields are empty
                philmodjunk

                In place of a tab control, put a Slide control on your layout with buttons set up as your tab labels. Each Slide control panel then needs to be given an object name in the inspector and the buttons just use Go to Object to bring a slide panel into view. To hide your panel, you now just hide the button for it.

                1 of 1 people found this helpful