3 Replies Latest reply on Aug 13, 2014 2:40 PM by philmodjunk

    Auto update of username and timestamp when a record is modified

    rakeshkatipalli

      Title

      Auto update of username and timestamp when a record is modified

      Post

           Hi every one .

           I am very new to this technology. In my database file i have a field called "notes" of length 5000. Whenever a user enter data into that field it has to display the user name and timestamp followed by the data he has entered.

           For example first the user "user1" is modified. Now it has to display the user name and timestamp followed by the data. Next time if "user2" has modified , it has to display his username and timestamp followed by the data.

           Now this field should contain "user1","timestamp" followed by the data and "user2", "timestamp" followed by the data and so on.

           Example data in the field: Rakesh(user1), 14:02:10. Hi everyone

           Danny (user2), 09:10:11. Hello all

        • 1. Re: Auto update of username and timestamp when a record is modified
          philmodjunk

               This looks like data that should be recorded in three separate fields, in two different records. A Time (your example is not consistent with a time stamp as it would include the date) or timestamp field, a text field for the user name and a text field for the user's note. Each user would then create a new record for their note and these notes would in most cases be displayed in a portal as they are usually associated with a record in another table that is the object of these notes.

               With that set up, a text field can be set up in Field Options to auto-enter the creator's user name. The Time(stamp) field can auto enter the creation time(stamp) and this will all happen automatically when the user either types data into the third field or clicks a button to create a new portal record. (There are two ways to create a new record in a portal.)

          • 2. Re: Auto update of username and timestamp when a record is modified
            rakeshkatipalli
            As you mentioned I have 3 fields(user modified,time modified and notes).First two fields are auto enter fields. Now my question is whenever a user enter data into the notes field,first it has to display the user modified ,time modified followed by the data he entered and if another user also enter the data into the same field and the same record, it has to display the user modified,time modified followed by the data he entered . That means now the notes field contains, first user modified,time modified followed by the data he entered and second usermodified,time modified followed by the data he entered in the same record . Example: Rakesh,10:12:10.hi every one. Danny,14:10:22. Hello all. The entire information mentioned in the Example should be there in the same field(notes) and in the same record.
            • 3. Re: Auto update of username and timestamp when a record is modified
              philmodjunk

                   What you describe is what I am suggesting that you NOT do. Use a portal to a related table. Each row of that portal is a separate record with it's own "modification" fields and a text field for recording a single note. Multiple notes from multiple users are NOT recorded in the same field. While this can be done, it is far less flexible than using a portal with one note in each record of the portal's table.

                   Each time that a user needs to record a new note, they create a new record for doing so in the portal.

                   If so desired, this portal can sort the notes to list the most recent note as the top note in this portal.