4 Replies Latest reply on Apr 7, 2016 1:57 PM by david@msnmedia.com

    Confusion About Hiding Fields

    RPeters

      Hi Everyone,

       

      I've been driving myself a little bit crazy in the last few days trying to figure out how to hide certain fields.  Usually I try to think of the opposite (when do I want to show this field?) and then turn it into the negative version of that.  This one has stumped me though.  Sorry the description of my problem is a little wordy.  Hopefully this makes sense:


      I have three variables that I'm playing with in my Income List, I think that's why I'm getting mixed up.  It starts when I create a new line on my Income List.  I choose the Account "Fundraising Income" (from a pop-up list of many accounts) and then comes the part that's causing me trouble.


      The three main variables are:

      -A button called "Select Fundraiser" (when you click on it, it shows a list of events, you then click the event you're looking for, and it'll automatically take you back to the Income list to populate the EventsIDfk field - the script works fine, I do know that!)

      -EventsIDfk (which I just mentioned - it gets automatically populated)

      -Non-Ticket Fundraising Income (a pop-up menu of other ways we get fundraising money aside from people attending events)


      Here's what I'm envisioning:

      -Before I choose "Fundraising Income" as the Account I don't want to see any of the above three field.  Everything should be hidden.

      -When I select "Fundraising Income" as the account, I want to see the "Select Fundraiser" button and "Non-Ticket Fundraising Income" pop-up list.  (Hide the EventsIDfk.)  The idea is that I'll be choosing one of the two options.

      -When I go ahead a click on the "Select Fundraiser" button (activating the script to choose the event, then get taken back to the Income list and have the EventIDfk field automatically populated) I then want to hide the "Select Fundraiser" button (because I've just selected the fundraiser!) and hide "Non-Ticket Fundraising Income". 

      -Alternatively, if I choose a value from the "Non-Ticket Fundraising Income" pop-up menu, I want to then hide the "Select Fundraiser" button and the EventsIDfk.

       

      I really hope I haven't lost you all!

       

      So I guess I'll just copy and paste how I'm hiding my fields right now.  Nothing is working so I know this is totally wrong, but I just can't figure out for the life of me how to fix it!

       

      For the "Select Fundraiser" button:

      Hide when:

      Income::Account Number    =   "Fundraising Events Revenue"

      and

      not IsEmpty ( Income::Non-Ticket Fundraising Income )

      and

      not IsEmpty ( Income::__EventsIDfk )

       

      For the EventsIDfk field:

      Hide when:

      Income::Account Number  ≠ "Fundraising Events Revenue"

      and

      not IsEmpty ( Income::Non-Ticket Fundraising Income )

       

      For the Non-Ticket Fundraising Income pop-up menu:

      Hide when:

      not IsEmpty ( Income::__EventsIDfk )

      and

      Income::Account Number  =  "Fundraising Events Revenue"

       

      Okay, I hope that makes some kind of sense to someone, because I've been driving myself absolutely nuts on this for the last few days.  As it stands right now, none of the fields are hiding - ever.  Even when the Account isn't even "Fundraising Income"!  All the field show up everywhere!  Ugh! Any suggestions you have would help alleviate the migraine I've caused myself!

       

      Thanks in advance!!

      -Rachael

        • 1. Re: Confusion About Hiding Fields
          fitch

          That's a bit much to absorb, but I can suggest what I sometimes do, which is to use a Case statement so I can evaluate my conditions one by one, e.g.:

           

          Case(

          Income::Account Number  = "Fundraising Events Revenue" ; 0 ;

          IsEmpty ( Income::Non-Ticket Fundraising Income ) ; 0 ;

          1 )

          • 2. Re: Confusion About Hiding Fields
            siplus

            give a name to each one of these fields, create a script that refreshes each of the three objects, put a OnModify trigger on each field calling the refresh script: does it make things better ?

            • 3. Re: Confusion About Hiding Fields
              erolst

              Wow, that sounds complicated.


              I would recommend creating a matrix of objects and conditions/states; usually that's the best way to get clarity about complicated Boolean logic.


              In the meantime: maybe try OR, rather than AND?

              • 4. Re: Confusion About Hiding Fields
                david@msnmedia.com

                Would this work?


                For the "Select Fundraiser" button:

                Hide when:

                Income::Account Number    "Fundraising Events Revenue"

                or

                not IsEmpty ( Income::Non-Ticket Fundraising Income )

                or

                not IsEmpty ( Income::__EventsIDfk )

                 

                For the EventsIDfk field:

                Hide when:

                IsEmpty ( Self )

                 

                For the Non-Ticket Fundraising Income pop-up menu:

                Hide when:

                not IsEmpty ( Income::__EventsIDfk )

                 

                Seems like the presence of anything in the EventsIDfk field should drive the invisibility of everything else, once you've selected "Fundraising Events Revenue" in the Account field. Also I think you need to use OR in place of AND as erolst mentioned.