1 2 Previous Next 21 Replies Latest reply on Sep 7, 2016 11:17 PM by bee13

    Multi-criterion FAIL for "Hide object when..." function

    bee13

      The following issue has me 'stumped.'

       

      Simply put, I want a certain layout object to hide when one OR more of many related fields are populated on a "Permission to Photograph" student record popover.

       

      I have fiddled with this thing for days and can't quite get it to fully cooperate.  Currently, the calculation seems to be non-reactive to date field, "$docDate."  All other fields, singly or in combination, appear to cause the calculation to respond appropriately, but not the $docDate field.

       

      I have tweaked and tweaked the calculation, trying patternCount, getAsText, isValid functions with the $docDate field as well as stringing the logical function "or" between each of the fields, etc.  The calc you see below is the closest I've been able to get to proper functioning.

       

      It seems that there are at least three possible problems: 1) The calc below is incorrectly written, or 2) the $docDate field has something wrong with it, or 3) both 1 and 2 have have simultaneous problems.

       

      $decline is a checkbox with the values "1" or empty

      $docInc is a checkbook with the values "1" or empty

      $auth is a text field

      $docDate is a date field

      $docLoc is a text field

       

      ----------------------------------

       

      Let ( [

       

        $decline = Students::PermToPhotoDeclined ;

        $docInc = Students::PermToPhotoDocInc ;

        $auth = Students::PermToPhotoAuthority ;

        $docDate = Students::PermToPhotoDocDate ;

        $docLoc = Students::PermToPhotoDocLoc ] ;

       

      or ( not (

        $decline ≠ 1

        and $docInc ≠ 1

        and not IsEmpty ( $auth )

        and not IsEmpty ( $docDate )

        and not IsEmpty ( $docLoc ) ) ;

       

        $decline = 1

       

      )

      )

       

      ----------------------------------

       

      Any ideas?

       

      Thanks in advance.

        • 1. Re: Multi-criterion FAIL for "Hide object when..." function
          David Moyer

          Hi,

          or ( not (

          $decline ≠ 1

          I'd like to start with the "or (" - please try deleting that.

          ... and its associated ")"

          • 2. Re: Multi-criterion FAIL for "Hide object when..." function
            bee13

            Okay, I've altered the calc.  It still has the same problem.  I isolated the $docDate line from the calc (as seen below) and the calc works as intended.  If I bring the $docDate line back in, the layout object hides in all cases -- not what I want...

             

            --------------------------------

             

            Let ( [

             

              $decline = Students::PermToPhotoDeclined ;

              $docInc = Students::PermToPhotoDocInc ;

              $auth = Students::PermToPhotoAuthority ;

              $docDate = Students::PermToPhotoDocDate ;

              $docLoc = Students::PermToPhotoDocLoc ] ;

             

              $decline = 1

              or $docInc = 1

              or not IsEmpty ( $auth )

              //or not IsEmpty ( $docDate )

              or not IsEmpty ( $docLoc )

             

            )

            • 3. Re: Multi-criterion FAIL for "Hide object when..." function
              alecgregory

              Let's fire up the patented indetifier:

               

              Let (

                   [

                        $decline = Students::PermToPhotoDeclined;

                        $docInc = Students::PermToPhotoDocInc;

                        $auth = Students::PermToPhotoAuthority;

                        $docDate = Students::PermToPhotoDocDate;

                        $docLoc = Students::PermToPhotoDocLoc

                   ];

                        or (

                        not (

                             $decline ≠ 1

                                  and $docInc ≠ 1

                                  and not IsEmpty ( $auth )

                                  and not IsEmpty ( $docDate )

                                  and not IsEmpty ( $docLoc )

                         );

                        $decline = 1

                   )

              )

               

              I'm surprised the above even evaluates. The calculation above treats or as a function, but it's an operator.

               

              Assuming your fields are OK, you probably want the following:

               

              Let (

                   [

                        $decline = Students::PermToPhotoDeclined;

                        $docInc = Students::PermToPhotoDocInc;

                        $auth = Students::PermToPhotoAuthority;

                        $docDate = Students::PermToPhotoDocDate;

                        $docLoc = Students::PermToPhotoDocLoc

                   ];

                   $decline = 1

                        or (

                             not (

                                  $decline ≠ 1

                                       and $docInc ≠ 1

                                       and not IsEmpty ( $auth )

                                       and not IsEmpty ( $docDate )

                                       and not IsEmpty ( $docLoc )

                            )

                        )

              )

              • 4. Re: Multi-criterion FAIL for "Hide object when..." function
                David Moyer

                please verify that the field Students::PermToPhotoDocDate is completely empty.  You might try $docDate > Date(1;1;1).

                Also, you might try to reformulate without the "double-negatives".

                And, one more, if you don't use say $auth elsewhere in your script, you can just use "auth" in your Let statement.

                1 of 1 people found this helpful
                • 5. Re: Multi-criterion FAIL for "Hide object when..." function
                  bee13

                  alec,

                   

                  I pasted your calc as written.  Result: Layout object in question starts out hidden and remains hidden regardless of whether the relevant fields are populated or emptied...

                  • 6. Re: Multi-criterion FAIL for "Hide object when..." function
                    bee13

                    David,

                     

                    Good idea to check that.  I modified the calc in the way you describe but it doesn't seem to alter the weird interaction between the $docDate field, the calc, and the layout object.

                     

                    When I isolate out the calc line that refers to $docDate everything else works as it should.  As soon as I re-introduce the $docDate line the layout object hides in all other cases...

                     

                    ----------------------------

                    Let ( [

                     

                      $decline = Students::PermToPhotoDeclined ;

                      $docInc = Students::PermToPhotoDocInc ;

                      $auth = Students::PermToPhotoAuthority ;

                      $docDate = Students::PermToPhotoDocDate ;

                      $docLoc = Students::PermToPhotoDocLoc ] ;

                     

                      $decline = 1

                      or $docInc = 1

                      or not IsEmpty ( $auth )

                      //or $docDate > Date ( 1 ; 1 ; 1 )

                      or not IsEmpty ( $docLoc )

                     

                    )

                    • 7. Re: Multi-criterion FAIL for "Hide object when..." function
                      David Moyer

                      Hi,

                      the way I read your logic from the original post is this (just as a "sounding-board") ...

                      If, it's not declined and $docInc is also false, and the three following fields are all populated: $auth, $docDate and $docLoc ...

                      then you're assigning the field or $variable Boolean condition to 0, otherwise, if any of the five conditions fail, 1.

                      I'm looking at the latest post.

                      • 8. Re: Multi-criterion FAIL for "Hide object when..." function
                        David Moyer

                        Again, as a sounding-board ...

                        the second calculation looks like:

                        If it's declined or $docInc is True and or either $auth or $docLoc is empty. or $docDate is not empty, it should return 1, otherwise, 0.

                        • 9. Re: Multi-criterion FAIL for "Hide object when..." function
                          bee13

                          David,

                           

                          Thanks for the reply.  My intention is to hide the "?" layout object if any of the five editable fields are populated; Declined = 1, Document Incomplete = 1 or if any of the three remaining fields are populated.  If any (or all) of these conditions are met then the result should be TRUE, or 1, and the "?" layout object should be hidden.

                           

                          FMpostGraphic.jpeg

                          • 10. Re: Multi-criterion FAIL for "Hide object when..." function
                            David Moyer

                            after putting my glasses on ...

                            (
                              $declined = 1 or
                              $docInc = 1 or
                              not IsEmpty ( $auth & $docDate & $docLoc )
                            )

                            ... The concatenation of the three text fields is just to shorten the formula.

                            • 11. Re: Multi-criterion FAIL for "Hide object when..." function
                              bee13

                              David,

                               

                              The "Hide when..." calc was modified to include the missing "not" logic operator in the $docDate field.

                              Result: Ultimate problem remains, that is that the $docDate field seems to have no influence on the 'hide' status of the "?" layout object whether it is populated (with an actual date or a contrived one, i.e. date ( 1 ; 1 ; 1 )), or empty.

                              1 of 1 people found this helpful
                              • 12. Re: Multi-criterion FAIL for "Hide object when..." function
                                BruceRobertson

                                Hide when:

                                 

                                ValueCount(

                                List(

                                Students::PermToPhotoDeclined ;

                                Students::PermToPhotoDocInc ;

                                Students::PermToPhotoAuthority ;

                                Students::PermToPhotoDocDate ;

                                Students::PermToPhotoDocLoc

                                ))

                                1 of 1 people found this helpful
                                • 13. Re: Multi-criterion FAIL for "Hide object when..." function
                                  bee13

                                  David,

                                   

                                  Thanks again for continuing to engage on this.  Modified the 'Hide' calc as seen below.  Result: "?" layout object is initially hidden and remains hidden in all field populated/empty cases and combinations...

                                   

                                  Let ( [

                                   

                                    $decline = Students::PermToPhotoDeclined ;

                                    $docInc = Students::PermToPhotoDocInc ;

                                    $auth = Students::PermToPhotoAuthority ;

                                    $docDate = Students::PermToPhotoDocDate ;

                                    $docLoc = Students::PermToPhotoDocLoc ] ;

                                   

                                    $decline = 1 or

                                    $docInc = 1 or

                                    not IsEmpty ( $auth & $docDate & $docLoc )

                                   

                                  )

                                  • 14. Re: Multi-criterion FAIL for "Hide object when..." function
                                    David Moyer

                                    Hi Bruce,

                                    I think the problem there is that if the numerical variables contained a 0, then the list would no longer be empty.  But it would definitely work for all text fields.

                                    Does that sound right?

                                    1 2 Previous Next