3 Replies Latest reply on Jun 2, 2009 11:08 AM by philmodjunk

    Button Help with date again

    anicolais

      Title

      Button Help with date again

      Post

      Hey,

      this is off my last question about how to make a button show a date everytime it is clicked. Is there a way to make the field continually add dates like a history insterad of deleteing and replacing the date every time? Thanks

        • 1. Re: Button Help with date again
          philmodjunk
            

          Yes,

           

          Define your field in your history table.

           

          Go To layout [History table layout]

          New Record Request

          Set FIeld [HistoryTable:: DateField, Get (CurrentDate)]

          Go TO Layout [Original layout]

           

          There are other ways you might modify this script depending on the structure of your data base and how you relate your history table to other tables in your database. You might, for example, have your script interact with a portal that displays a log of your dates instead of switching layouts.

          • 2. Re: Button Help with date again
            anicolais
               Not exactly what i had in mind i dont think. Heres the situation i have the button and the field on the same layout (I only have 1 layout). I am trying to make this field when the button is clicked track a new date in the same field in like a list sort of view without deleting the date that was already entered. For example right now if i click it once it say 6/2/09 if i click it again it jsut replaces it with 6/2/09 i want it to have 2 instances of 6/2/09 in the same field and so on for everytime it is clicked.
            • 3. Re: Button Help with date again
              philmodjunk
                

              You can use a text field and the script step:

               

              Set Field [YourTable::textField, If (isempty(yourtable::textfield), Getastext(get (currentdate)),  Getastext(get(currentdate)) & "¶" & YourTable::textField)]

               

              You lose the ability to treat this field as a date field and you can't as easily use it in reports.

               

              That's why I recommended a separate table. It's fairly easy to set up and gives you more flexibility in how you can work with the logged dates.