1 2 Previous Next 19 Replies Latest reply on Apr 23, 2015 2:29 PM by disabled_jackrodgers

    Strange "Hide object when..." results!

    artdoc

      Working on a database for FM GO and have suddenly hit a curious glitch. I have been using the Hide option to great advantage, popping up specific edit fields depending on a choice in a value list. Good space saving for the iOS stuff. Now this morning I set a field to hide when, set up my Boolean and the field disappeared, as expected. But when I made the selection that should have revealed the field, it failed. Worse yet, it si,ply never came back to view.

      To make this harder to figure out, it only failed on one specific value choice. If my list was A,B,C,D,E,, and F, I set it to hide if choice was NOT B. So then hidden, if I chose B, no appearance. But other fields set to use other values work perfectly.

      I dragged off a copy of a field that was working fine (hiding/showing) and rewired it to B. It failed. I created a fresh value list, same results. One specific value seems ro make the selected field stop showing at all, never to return no matter the value selected!

       

      Anyone else had this happen?

        • 1. Re: Strange "Hide object when..." results!
          electon

          Can you evaluate this in data viewer?

          Should either be true or false.

          Sounds like you're evaluating base on a value list. These can be tricky.

          Do you refresh the window or the object, any commit records steps?

          • 2. Re: Strange "Hide object when..." results!
            Benjamin Fehr

            Shake the tree

            First for debugging is always commit records and refresh-window (incl. try with x Join in cache …).

            Next would be to check syntax in formula and dependencies of relations

            • 3. Re: Strange "Hide object when..." results!
              artdoc

              I am, in fact, evaluating based on a value list. There is no script, per se, simply a  "rule" added in the Data tab for the menu and : Hide object when: "Taxi Trips::Pay Method ≠ "Logisticare". I also have another set of three fields AND their labels that are all set to hide while Pay Method is NOT "CC" (fields for credit card data) and they work perfectly. In fact all other fields work as expected.

              This is a two part project: one part stays on the desk at HQ, another part works on iP{hones for workers in the field. I have set up this exact set of pop-up-menu and value list with the same options, it works fine on my Mac. There is an oddity on the iPhone because a pop-up-menu doesn't display in the usual way on iPhones! It drops a new window, options listed in tiny print, but it works.So of course I'm stumped by what's different about the word "Logisticare" that seems to be the problem on the desktop monitor.

               

              Again, Data Viewer or Script Debugger were good suggestions, but there is no scripr! Those tools simply display empty windows. Unless I'm realling missing something, I thought FM Pro commited records with every step? I think I'll create a small new file with only a button and a set of a few fields. Except, of course, that I already have that in my iPhone version...And it works.

              • 4. Re: Strange "Hide object when..." results!
                erolst

                artdoc wrote:

                Again, Data Viewer or Script Debugger were good suggestions, but there is no scripr! Those tools simply display empty windows

                 

                The Data Viewer can be used outside of any script: you can manually add expressions to Watch (be it simple references or entire calculations), which is this case would be the Hide calculation and/or the field(s) it is based on. This not only help to see if your data is what you expect, but also, and more to the point, if it is evaluated as expected.

                 

                artdoc wrote:

                I thought FM Pro commited records with every step?

                 

                Not necessarily; and sometimes a Commit isn't enough to update related data within the current context; you need to throw in a refresh …

                • 5. Re: Strange "Hide object when..." results!
                  electon

                  artdoc wrote:

                   

                  I am, in fact, evaluating based on a value list. There is no script, per se, simply a  "rule" added in the Data tab for the menu and : Hide object when: "Taxi Trips::Pay Method ≠ "Logisticare". I also have another set of three fields AND their labels that are all set to hide while Pay Method is NOT "CC" (fields for credit card data) and they work perfectly. In fact all other fields work as expected.

                  What I ment is does the field you're evaluating the hide condition on contains a value list like:

                  Value 1

                  Value 2

                  Value 3

                  separated by carriage return.

                  or is it a field holding only one value for payment type that gets selected from a value list?

                   

                  Is the value list based on another table ( payment types ) or just whatever you typed into it.

                  Once again, at least check your field in the Data Viewer which value it holds ( in the Watch tab of the DataViewer ).

                  Also it could be a typo in the calculation, check for leading / trailing spaces on "Logisticare" and if it corresponds to what is in the value list.

                  Do a Refresh Window ! after changing the value. 

                  • 6. Re: Strange "Hide object when..." results!
                    gziemann

                    Try using PatternCount

                     

                    PatternCount (Taxi Trips::Pay Method; "Logisticare") ≠ 0


                    Or even shorten it a little to rule out spelling:


                    PatternCount (Taxi Trips::Pay Method; "Logi") > 0

                    • 7. Re: Strange "Hide object when..." results!
                      techt

                      You might try re-entering the value list, perhaps a space or other hidden character was introduced. I've seen this happen when pasting a value list into the box. Another option to try is create a new value list and link the hide calc to that. I've seen issues in the past using hide where a multi-conditional hide doesn't work as expected, but that doesn't sound like the case here.

                       

                      HTH,

                       

                      TT

                      • 8. Re: Strange "Hide object when..." results!
                        erolst

                        gziemann wrote:

                        Try using PatternCount

                         

                        If you have a field that is supposed to only hold one value (radio buttons), PatternCount() isn't necessary; if the field could hold several values (checkbox), and one might be a substring of another, it's too lax, and you should use FilterValues().

                         

                        At any rate, calculations shouldn't have to cater for faulty data; you should ensure correct data (entry) in the first place.

                         

                        Another thing to consider is that Payment methods are business data in the OP's solution; I'd suggest storing them in their own table and generating the value list from field values; among other things, this allows applying validation and other rules, and allows using these terms in a more structured manner.

                        • 9. Re: Strange "Hide object when..." results!
                          artdoc

                          PatternCount? Neat idea!! The good news for me is that I don't have to have a menu to select data, it's just a convenience to "stack up" empty fields ( this is for display on an iPhone) for input based on the payment method. It works wonderfully on every choice but the one option of "Logisicare", and I have even chanbgfed that ti "Insurance" and it fails as well. I moved it to another place in the list, failure. This is too strange.

                           

                          I have found some cool ways to use patternCount but this one is a novel new way to think. I'll give it a go. Thanks.

                          • 10. Re: Strange "Hide object when..." results!
                            artdoc

                            "perhaps a space or other hidden character"

                            I appreciate the input, but I have built new lists, no spaces fore or aft, even created a new table to try using options from a field, then a custom value list. Absolutely nothing lets this ^%$# hidden field return to view once hidden. And only with the one option choice, Others work fine. I'm going to make a small example  to post here, just for fun. Of course then it will work!

                             

                            EDIT: I made a test, and of course, I can't get iut to fail! But here's what all the fuss has been about. And thanks for the input, guys!

                            • 11. Re: Strange "Hide object when..." results!
                              gziemann

                              erolst wrote:

                              If you have a field that is supposed to only hold one value (radio buttons), PatternCount() isn't necessary; if the field could hold several values (checkbox), and one might be a substring of another, it's too lax, and you should use FilterValues().

                               

                              We don't know if the OP is using radio buttons, a checkbox, a dropdown or a popup list (he didn't specify). If he is using a dropdown list to select from his value list, then it is possible to override the choices and type in anything you want in that field, which makes PatternCount() a perfectly cromulent choice. The OP is using a value list, so as long as the string he is checking is unique to the choices offered, it would work just fine.

                               

                              At any rate, calculations shouldn't have to cater for faulty data; you should ensure correct data (entry) in the first place.

                               

                              You should certainly make an effort to ensure correct data entry but there is no harm in checking for faulty data. I've been programming for 25 years and it is my experience that end users are highly creative in their ability to not do things the way you expect them to.

                               

                              Everyone has their own thought process in programming and FileMaker offers multiple ways to solve the same problem (as do most other programming environments). I am always wary of people who tell me that you should do something a certain way because there are always options, depending on the situation, especially when you don't know all of the specifics.

                              • 12. Re: Strange "Hide object when..." results!
                                erolst

                                gziemann wrote:

                                We don't know if the OP is using radio buttons, a checkbox, a dropdown or a popup list (he didn't specify). If he is using a dropdown list to select from his value list, then it is possible to override the choices and type in anything you want in that field, which makes PatternCount() a perfectly cromulent choice.

                                 

                                At any rate, they're using a value list, probably for the reason to constrain the possible input; so IMO a more reasonable strategy is to enforce such a constraint(s), rather than checking for every misspelling or substring under the sun.

                                 

                                Also, using a dropdown list doesn't make particular sense here when the values are expected to come from a narrow and pre-defined domain (but YOMD).

                                 

                                btw, I'm not “telling” you anything; I'm merely pointing out that PatternCount() doesn't strike me as particular “cromulent” in this scenario, for the reasons described, given the facts known (as they were).

                                • 13. Re: Strange "Hide object when..." results!
                                  gziemann

                                  Also, using a dropdown list doesn't make particular sense here when the values are expected to come from a narrow and pre-defined domain (but YOMD).

                                   

                                  Really don't want to have an argument in the OP's post. I didn't have an opinion, which is where you and I differ on this. You have ruled out a dropdown list because it doesn't make sense to you. You made an assumption based upon your opinion. I did not. I offered an option based on a possibility, which remains as a possibility whether or not you or I think it is the best path to take..

                                  • 14. Re: Strange "Hide object when..." results!
                                    schamblee

                                    I downloaded the sample file and I didn't have any issues with it.  I would run recover on the problem file to see if FM finds any problems.  The object may be corrupt or some other item.   You might try recreating the layout.  I wouldn't copy any thing from the old layout to the new layout incase there is some corruption, you don not want to copy the problem..

                                    1 2 Previous Next