2 Replies Latest reply on Feb 21, 2017 11:05 AM by ericjlindholm

    boolean toggle via button inconsistancy

    ericjlindholm

      is there any reason a toggling a boolean field to not self with a button would set the field to empty instead of 0? 

      or a 1 ¶ 0?

       

      my button is a single step that says set field [ inventory::inactive ; not inventory::inactive ]

       

      The auto enter data on the field is 0 and is set to a number.

       

      I cannot seem to recreate the issue consistently and engaging that button again fixes the issue.  I know it could be something somewhere else in my file but this should only be edited in one place.

       

      any help would be appreciated.  thanks!

        • 1. Re: boolean toggle via button inconsistancy
          philmodjunk

          Could the record be locked by another user or a script? That lock, however brief, would prevent the update, but you should also get an error message that it's locked unless your button's script includes set error capture [on]

           

          If the only thing that button does is toggle that value, I'd replace it with a check box where the value in the value list is just the value 1. You can size the field so that the 1 is not visible. This does result in an empty field in place of zero, but since empty evaluates as zero, you can often work with that in FileMaker without any trouble. The exceptions being in existing finds that specify the zero value and relationships that can't match to an empty field so your mileage may vary with that suggestion.

           

          Edit note: just noticed some nonsensical text in my suggestion on using a check box instead of a scripted button and have made the needed edits to correct that.

          • 2. Re: boolean toggle via button inconsistancy
            ericjlindholm

            I did not have the checkbox that was used for displaying the value had editing in browse mode enabled on it. 

            It is was supposed to be disabled so the button that corresponds with it is the only thing function that triggers the change.

            Thanks so much for taking the time to reply phil.  I just needed a lil nudge!