6 Replies Latest reply on Jul 8, 2011 1:23 PM by philmodjunk

    Changing Date

    DavidCowan

      Title

      Changing Date

      Post

      Hello,

      I am attempting to update the dates in a field, that tells me that it is not modifiable. I have searched and printed out the db design report and I don't see where this set, the fields are calculations, Is there a way to modify the following code to allow date changes to the not modifiable fields.

      Thank You

       

      Let ( [ x = Today ; y = Year ( x ) ; z = Car::Car Cls  ] ; If ( z ≠ "MAC" and z ≠ "WC" ; Date ( 7 ; 1 ; y - If ( x < Date ( 7 ; 1 ; y ) ; 1 ) ) ) )

        • 1. Re: Changing Date
          rjlevesque

          Got this box unchecked?

          properties window

          • 2. Re: Changing Date
            philmodjunk

            rjlevesque has asked the right question if this is a date field with an auto-entered calculation.

            Is there any chance that this is a field of type calculation that is set to enter a date?

            If this is a calculation field, you can convert it to a date field with the above calculation as its auto-enter calculation. As long as the "Prohibit modification..." and "Do not replace existing value..." options are not selected, each new record will receive this calculated value, but you can then edit the auto-entered value as needed.

            All of what we are discussing here are options you can select/change via Manage | Database | Fields.

            Here's a quick analysis of your calculation:

            This calculation draws on values from two other fields: Today (defined in the same table as this date field), and Car::Car CLs (a field defined in another table and linked to this table via a relationship to a box in Manage | Database | Relationships named "Car").

            Today is probably an unstored calculation defined as Get ( CurrentDate ), but it may be a date field that is updated with Get ( CurrentDate ) each time you first open the file. (If it does, it may take a while to open the file and you might see a progress bar while the script updates this field) That's something that is sometimes introduced into an older version file when it is converted to a newer version which no longer has the Today function often used in some older versions of FileMaker.

            Thus, your other option for modifing the date that is entered into this field is to either enter the values returned by these two fields or to double click this field's definition in Manage | Database | Fields to bring it up and edit it so that it computes a different value.

            • 3. Re: Changing Date
              DavidCowan

              You are right it is a Calculation field that is set to enter a date. Is there a way to at least let me alter the date without the you cannot modify this coming up evertime I attempt to change the date. I want to be able to Enter say 07/06/2011 which then auto computes the exp date in the lower calcualation date.

               

              Probably not asking this correctly but hey thought I would give it a shot.

              • 4. Re: Changing Date
                philmodjunk

                If this is a calculation field, you can convert it to a date field with the above calculation as its auto-enter calculation. As long as the "Prohibit modification..." and "Do not replace existing value..." options are not selected, each new record will receive this calculated value, but you can then edit the auto-entered value as needed.

                • 5. Re: Changing Date
                  DavidCowan

                  How would I convert it? Yes I know nothing.

                  • 6. Re: Changing Date
                    philmodjunk

                    Make a back up copy of your file so that you can throw out your current file and try again if you don't get something that works for you.

                    Open Manage | Database | Fields

                    Find this field

                    Click to select it and use the type drop down to change the field to a field of type date.

                    Click Options

                    Click the auto-enter tab.

                    Click to select the Calculated Value Option

                    You'll find your original calculation has been entered for you as the Auto-entered Calculation, so click Ok to close the Specify Calculation Dialog.

                    Now make sure that the "Do not replace existing value" option is not selected.

                    With these options, when you first create a new record in this table, the calculation will attempt to enter a date, but you can then enter this field and edit the date returned.