5 Replies Latest reply on Aug 2, 2010 2:37 PM by LaRetta_1

    How to limit a date entry to 5 week in the future.

    PeterJeans

      Title

      How to limit a date entry to 5 week in the future.

      Post

      I am trying to create a system for booking events for my school that limits entries to future dates based on what sort of activity is selected.

      i.e. one field (activity) can select from Professional Learning, Excursion and Camp.

      THen the date field below (with calendar popup) can only select dates 2 week, 5 weeks or 2 months in the future?

      How would one do this?

        • 1. Re: How to limit a date entry to 5 week in the future.
          LaRetta_1

          Your request isn't clear to me. 

          If you provide a calendar pop-up then the date selection can't be restricted except by validation (unless you use script triggers).  What version of FileMaker are you using?

          If you want User to select from calendar pop-up then must be EXACTLY at today + 14 days? or today + 35 days etc or do you mean maximum of number of days/weeks/months instead?

          You list three activities ... are you saying that Professional Learning can ony select max two weeks ahead, Excursion can only select 5 weeks ahead or Camp can only select 2 months ahead?

          Also, if someone specifies Excursion and system inserts date 5 weeks from today and then three days later the person changes the Activity to Camp, do you want the calculation to re-figure (adding to the original date and forward) or re-start the calculation from the new 'today' and restrict forward two months)?

          Please give specific examples and re-specify your business rules.   :^)

          • 2. Re: How to limit a date entry to 5 week in the future.
            PeterJeans
            Basically we want staff not to be able to apply for an activity within a set period. This is so that the necessary planning and approval steps can take place. We don't want them to be able to change the details once they are entered, they would need to create a new proposal orherwise they can adjust things at the most innopportune times. We want some fields they can not alter- the approval boxes which can only be ticked approved by a manager. We would also like the costs hidden from view after the details are entered so that other users do not see this. We want them to be able to see the progress of their application, but not alter it after it is entered. I am happy to use validation or scripting, whichever is easiest.
            • 3. Re: How to limit a date entry to 5 week in the future.
              LaRetta_1

              "I am happy to use validation or scripting, whichever is easiest."

              OK. So, as I asked above, please answer the questions and provide your business rules on the specifications and what version are you using.  Our answer will depend upon 1) your version and 2) exactly what the validations will be.  You didn't provide any of that information for us.

              • 4. Re: How to limit a date entry to 5 week in the future.
                PeterJeans

                I am using filemaker pro advanced version 10.

                It will be hosted on FM9 server and accessed via webpublishing for staff.

                2 USer levels - User for entering requests and viewing progress of requests, Manager - for viewing, altering and approving requests. It should have a save button that only saves (or posts to another table) when users have entered all the required information.

                Key Fields.

                Field- Activity type: Selected via a pull down field as "Camp", "Excursion" or "Activity".

                Field- Activity Date: Selected via pop-up calendar - limitations imposed depending on what is selected in Field Activity type. See below.

                Field- Activity Cost: Dollar Value - hidden to other users once it is entered and saved. (This could possibly be achieved by making the data entry form a separate form that copies values to another table in the database)

                VALIDATION RULES

                IF ACTIVITY TYPE- 'Camp' is selected. If camp is selected, then user can not select an Activity date within the next 2 months. The field should blank out again and a message alert the user that they need to select a date more than 2 months in advance, the record should not be saved or other fields accessed until a correct date is entered. The date entered should be in format dd/mm/yyyy, there is no limit into the future, and there is no restriction on selecting weekends.

                IF ACTIVITY TYPE- 'Excursion' is selected. If excursion is selected, then user can not select an Activity date within the next 5 weeks. The field should blank out again and a message alert the user that they need to select a date more than 5 weeks in advance, the record should not be saved or other fields accessed until a correct date is entered. The date entered should be in format dd/mm/yyyy, there is no limit into the future, and there is no restriction on selecting weekends.

                IF ACTIVITY TYPE- 'Activity' is selected. If excursion is selected, then user can not select an Activity date within the next 2 weeks. The field should blank out again and a message alert the user that they need to select a date more than 2 weeks in advance, the record should not be saved or other fields accessed until a correct date is entered. The date entered should be in format dd/mm/yyyy, there is no limit into the future, and there is no restriction on selecting weekends.

                I hope this is enough information??

                • 5. Re: How to limit a date entry to 5 week in the future.
                  LaRetta_1

                  Nicely explained and just the right amount of information!!

                  I've attached a file http://www.4shared.com/file/xRSwMNv0/activity.html

                  It is scripted method using globals instead of field validation since you will be using it in web publishing and "It should have a save button that only saves (or posts to another table) when users have entered all the required information."

                  I have tried to present user with drop-down calendar for selecting their dates (but I pre-fill with the minimum future date for each Activity).  If they have to start over, it again pre-fills.  This should get you moving on the theory (check the script and also the auto-enter by calculation). 

                  UPDATE:  The script to proceed should begin with making sure all the fields have a value and if not, provide Custom Dialog to the User and halt or exit the script.