2 Replies Latest reply on Oct 11, 2010 8:49 AM by revmk

    Validation Woes

    revmk

      Title

      Validation Woes

      Post

      Hi all,

      I'm having problems validating some input data.  I think it is a two fold problem really.

      Initially I started my solution in an 'always save' mode as it seemed easy enough to get started with and I didn't want a load of complex layouts with associated scripts.  However I have now found that validation is a little on the sticky side.

      I have 4 fields (a, b, c, d).  3 of which (b, c & d) should only hold data if, field a is true.  However here lies the problem.  If I add validation to field b along the lines of;

      If (field_a = 1 and Length ( field_b ) >1  and Length ( field_b ) <16 ; 1 ;0) <<custom error>>

      An error is generated if field_a is accidently set to 1 and then reverted - OK, so it did what I told it to do.  So I thought maybe I could add 'allow user to override' the validation.  However this creates problems if the user really did want field_a as 1 and the opther fields are accidently blank, too short etc.

      OK, so maybe turning off auto save is the best idea so that the validation is not carried out until the end.  The problem with this is that it means I now have to maintain 4 layouts of reasonably complex layouts (two edit mode, 2 read only - as I have some fields that I do not wish to show based on a selection).  

      Surely there is a better solution to this?  

      It is annoying to me that I can't 'hide' a field based on a selection of another field, unfortunately custom formatting just doesn't cut far enough in as the fields are still usable if a user knows where they are.

      Thanks

        • 1. Re: Validation Woes
          philmodjunk

          There are ways to hide and reveal a field or other layout elements.

          You can create an invisible tab control and give the tabs object names. Tab one is empty, tab two has your fields or other layout objects. Use a script (can be controlled with script triggers) and the go to object step to select tab two to reveal the hidden layout elements.

          You can place a  portal to a single portal row (resize the row to be much taller than the default if you need the extra space.) Now you can hide and reveal items in the portal by changing a value in the parent record's key field so that their either is or isn't a related record visible in the portal. (And in FileMaker 11, you can also manipulate a global variable so that a portal filter hides and reveals the related record.)

          • 2. Re: Validation Woes
            revmk

            Hi PhilModJunk,

            Thanks for your help (again!)

            I take the point re: tab controls, but feel it is a slightly cluncky way of showing/hiding things.  Maybe I'll post it in the feedback forums.

            Thanks