7 Replies Latest reply on Jan 5, 2011 3:23 PM by philmodjunk

    New portal record drop down calendar enters wrong date

    JCrawford

      Title

      New portal record drop down calendar enters wrong date

      Post

      I am using both Ver 10 (on Vista) and Ver 11 (on Windows XP), and this problem occurs in both versions. I'm stymied.

      My layout (Clients) has a portal to a related table (Tests). The relationship allows the creation of new records in Tests (one client has many tests).

      My small Test portal has two visible fields - the scheduled test date and the test type. I use this small portal to schedule future test dates for that client.

      The date field has a drop down calendar. It has no other behavior or conditions or script triggers or auto-enter calcs. It is just a "drop down calendar." Because I've sorted by date, it is also indexed.

      When I want to schedule a new test for a client, I click in the new, empty portal row into the date field, the calendar pops up. The calendar has the current date highlighted, but I always select a future date. I click on the desired future date, and see that date flash by quickly, but when I leave the field, the field populates instead with the current date, not the date I've selected.

      This is only a problem in the record creation row. If I click back into that same field and choose my desired date, this time it works properly. Bottom line, in order to get my desired date, I have to enter the calendar twice. The first entry creates a new record. The second time in I can fix the date. 

      I could fix this with a script (which includes a commit record before the date is selected). But I'm wondering if I have missed a setting, or if this is a bug.

      Thanks for any help.

        • 1. Re: New portal record drop down calendar enters wrong date
          philmodjunk

          I'd open Manage | Database | Fields, find this field and double click it to bring up the field options dialog so you can check the auto-enter options for the field.

          I'm guessing here that you have it set to auto-enter the creation or modification date or possibly you have a calculation that uses Get ( CurrentDate ) to enter today's date.

          • 2. Re: New portal record drop down calendar enters wrong date
            JCrawford

            Thanks for your effort Phil. I don't want it to enter the current date - I want it to enter a future date of my choice. Are you suggesting forcing the field to enter the current date first, then I click into it to enter a future date?

            Thanks for your clarification.

            • 3. Re: New portal record drop down calendar enters wrong date
              philmodjunk

              No, it sounds like that's what you already have specified and needs to be changed so that the current date is not entered.

              • 4. Re: New portal record drop down calendar enters wrong date
                JCrawford

                Thanks for your clarification.

                The field of concern is a simple date field with no auto-entries, field script triggers, layout script triggers, or calculations, etc. that might prompt the date to revert to the current date after I've selected my desired date.

                However, the field is a match field between the Client and Test tables. This particular table occurrence ("Upcoming Tests") is looking for dates > or = the current date, a global date on the Client table. By definition, a record in this portal must have a date, and to remain in the portal after I exit, it must meet this criteria.

                Maybe because I'm typing into a portal that requires a date, FileMaker is selecting a date that matches the criteria (>= current date). Thoughts?

                • 5. Re: New portal record drop down calendar enters wrong date
                  philmodjunk

                  This is due to the field being a match field in a relationship where "Allow creation of records via this relationship" is enabled.

                  What's the exact relationship you've defined here and why?

                  I'm guessing:

                  Clients::globalDateFIeld > Tests::DateField AND
                  Clients::ClientID = Tests::ClientID

                  If this is the relationship, it's auto-matically entering the contents of your global date field. If you put the desired date in the global date field first, you can create the related record with out entering any date in DateField at all, you can just enter data in another field in the portal row. That might not be the optimum solution here though. Tell me more if you want to discuss alternate approaches.

                  • 6. Re: New portal record drop down calendar enters wrong date
                    JCrawford

                    Thank you very much. You are absolutely right. The relationship between my client table and a test table occurrence called NextTest is as follows:

                    Client::CurrentDate(global) <= NextTest::Scheduled Test Date
                    Client:ClientID = NextTest:ClientID

                    I was using the portal for two conflicting purposes: 1) to display the test dates that are scheduled in the future and 2) to create new test records with dates greater than the matching current date field.   

                    I understood the unique key field in my parent table would populate the child record's foreign key upon record creation, but it didn't occur to me that other matching fields would do the same thing when "allow record creation" is checked.  That's a great feature to send a lot of data to a child record, but I wasn't using it properly.

                    I will move the record creation function to another portal that doesn't match by date.  

                    Thank you for the new insight, and for understanding my problem long distance!!

                     

                    • 7. Re: New portal record drop down calendar enters wrong date
                      philmodjunk

                      Since you are using FileMaker 11, you might just use a portal filtering expression to filter out all but dates for today and later.

                      Get ( CurrentDate ) < NextTest::Scheduled Test Date