8 Replies Latest reply on Nov 14, 2013 10:26 AM by ChrisJohnston

    Mandatory Values

    ChrisJohnston

      Title

      Mandatory Values

      Post

           Mandatory Values

           What are the concepts to begin understanding to not ever let a field be empty or not one of you possible values you want?  For instance:

             
      •           Cat or Dog for the purpose of what you are doing are all you need to receive as data
      •      
      •           You also never want it to be “”, NULL, FALSE, 0, or Empty (so something like 1 could do)

           I have started understanding about Auto Enter but this is more of a Validation Issue correct? Does it need to be a Value List or can a calculation do the trick? I guess scripting could be this type of sentinel as well?

        • 1. Re: Mandatory Values
          philmodjunk

               I'm not sure that I understand your examples.

               Reducing opportunities for data entry errors usually requires careful thought and a layout design that prevents as many errors as possible, then checks for errors that can't be prevented after data entry is complete. Thus many of the following options are used in combination:

               If you want to make sure that a field always has the value Cat or Dog in the field, you can define a validation calculation such as:

               self = "dog" or self ="cat"

               IF the field can also be empty:

               IsEmpty (self) or self = "dog" or self ="cat"

               But this traps for an error after the user has made an error. You can also define a field format with a value list such that "cat" and "dog" are the only options permitted for entering data into that field. If the field cannot be left empty, there's a specific validation option that will show an error if the field is left empty.

               If you want to use an auto-complete enabled drop down list, but limit input to only values from the list, there's a validation option that will limit data in the field to only data that is a member of the value list.

               Sometimes an auto-enter calculation such as:

               TextFormatRemove(Self) //removes pasted or user selected text formats

               or

               GetValue ( self ; 1 ) // keeps user from selecting more than one radio button by holding down the shift key while clicking

               will be used to prevent data entry errors.

               And for maximum flexibility and user friendliness when trapping and possibly correcting data entry errors, the OnObjectValidate trigger can be used to check for and even correct user errors before any built in error checking can kick in.

          • 2. Re: Mandatory Values
            ChrisJohnston

                 I want the field to never be empty, could that also be:

                 self = "dog" or self ="cat" or self=1

                  

            • 3. Re: Mandatory Values
              philmodjunk

                   IF the only permitted values are dog, cat or 1. That doesn't seem likely for most actual situations.

              • 4. Re: Mandatory Values
                ChrisJohnston

                     For the purpose doing doing other things like with relationships like filtering and using ExecuteSQL I have ran in to trouble when a field is Empty, "", or False

                • 5. Re: Mandatory Values
                  philmodjunk

                       yes, but using self = 1 does not guarantee that the field is not empty. It requires that the value in the field be 1.

                       There's a validation option where you can just click a check box to specify that the field may not be left empty.

                  • 6. Re: Mandatory Values
                    ChrisJohnston

                         So once checked  and a Validated by calculation should do it?

                    • 7. Re: Mandatory Values
                      philmodjunk

                           Yes, but as I stated in my first post,

                           self = "dog" or self = "cat"

                           will also trap for empty values--you don't need any other setting as an empty value will not evaluate as true with that expression.

                           And I still don't see why you are also using: or self = 1 unless you want to permit only values of dog, cat or 1 as valid data for the field.

                      • 8. Re: Mandatory Values
                        ChrisJohnston

                             I totally understand. The concept you give helps, however in this case I do very much need the 1. I have always wondered what my C++ instructor meant by trapped. You have really made me understand here. Great!