6 Replies Latest reply on May 21, 2014 5:33 PM by keywords

    Form data validation question.

    eliahoo

      I have a record detail layout “employee detail”

      I have a database with table:: EMPLOYEE, table::CERT_LINE that is populated via dropdown from table: CE_COURSE.

      I have an entry container that enters and displays a list of entry values to CERT_LIST which include ::COURSE_NAME and ::EXP DATE

      I have a container that displays a set of check boxes that use control from EMPLOYEE::CERT_LIST CHECK and validates against a list for populating the check boxes with checks: using the following calculation type:

      If(

      PatternCount ( CERT_LIST ; "AWCT Arduous WCT" ); "AWCT Arduous WCT¶"

      ) &

      If(

      PatternCount ( CERT_LIST ; "I-100 Introduction to Incident Command System" ); "I-100 Introduction to Incident Command System¶"

      ) &

      If(

      PatternCount ( CERT_LIST ; "IS-00700 National Incident Management System: An Introduction" ); "IS-00700 National Incident Management System: An Introduction¶"

      ) &

      If(

      PatternCount ( CERT_LIST ; "L-180 Human Factors in the Wildland Fire Service" ); "L-180 Human Factors in the Wildland Fire Service¶"

      ) &

      If(

      PatternCount ( CERT_LIST ; "RT-130 Annual Wildland Refresher Course" ); "RT-130 Annual Wildland Refresher Course¶"

      )

       

      PROBLEM: right now the validation populates the check boxes if the course is on the list. I need to also validate the date as not being expired. Not less than today + 30

       

       

      perhapsI need to insert an AND statement such that the ::COURSE_NAME AND::EXP_DATE are validated Such that the check box is not checked unless the CERT_LINE::EXP_DATE is greater than today or ideally today + 30

      If(

      TODAY <> 1;"_? "

      ) &

      If(

      CERT_LINE::EXP_DATE < GetAsDate(Get ( CurrentHostTimeStamp ));"_? "

      )

        • 1. Re: Form data validation question.
          erolst

          Try

           

          Case (


            CERT_LINE::EXP_DATE > GetAsDate ( Get ( CurrentHostTimeStamp ) ) + 30 ;

           

              Let ( [

                a = "AWCT Arduous WCT" ;

                b = "I-100 Introduction to Incident Command System" ;

                c = "IS-00700 National Incident Management System: An Introduction" ;

                d = "L-180 Human Factors in the Wildland Fire Service" ;

                e = "RT-130  Annual Wildland Refresher Course"

                ] ;

           

                FilterValues ( CERT_LIST ; List ( a ; b ; c ; d ; e ) )

            )

          )

          • 2. Re: Form data validation question.
            keywords

            I would definitely recommend that you study the alternative formula structure suggested by erolst, and teach yourself to use the Let ( ) function. However, there appears to be a problem with the formula you have posted anyway. I assume each of the If()s is meant to be a condition which must be met; if so, wherever you have "&" you need to use "and" instead.

            • 3. Re: Form data validation question.
              eliahoo

              I am working on an application that I did not create. It functions as it is so I don’t want to break it.  I just need to figure out how to make the calculation to include the date….  There is another element that is related to the way it functions, I will analyze the complete structure and try to map it out logically.  I am not very familiar with filemaker scripting functions so I am a little lost, but I understand the underlying logical structure and have some knowledge of database design in a sql environment (aside from a journey into filemaker in ….my god 1991 or 2………thanks for looking at this, I really do appreciate it…

              • 4. Re: Form data validation question.
                erolst

                keywords wrote:

                 

                I assume each of the If()s is meant to be a condition which must be met; if so, wherever you have "&" you need to use "and" instead.

                 

                I thought so, too, upon seeing the word “validation”; but reading the text indicates that the original calculation was intended to return a list result – also note the inserted pilcrows – with each value's presence conditional, and that the term does not refer to “field validation”.

                • 5. Re: Form data validation question.
                  erolst

                  eliahoo wrote:

                  thanks for looking at this, I really do appreciate it…

                   

                  Why, you're welcome …

                  • 6. Re: Form data validation question.
                    keywords

                    Ah, yes. No substitute for close reading of the detail!