6 Replies Latest reply on Aug 6, 2013 7:20 AM by paul350passaic

    Edit box that will auto paste with timestamp and username.

    paul350passaic

      Title

      Edit box that will auto paste with timestamp and username.

      Post

            

           I'm trying to set a field where it will paste automatically its content to another field when you click save or "OnObjectSave" trigger but with a time stamp and username with it. So therese 2 field involved. 1st named "NotesEditBox" and 2nd "Notes". I disable "Notes" in find and browse mode so no one can change or delete an entry, hence the "NotesEditBox" where all information will be entered and will automatically paste its content to "Notes" once saved, but with time stamp and user name.
            
           heres a screen shot. its simple but will help us a lot track all update notes.
            
           Thanks !

      Screen_Shot_2013-08-02_at_12.01.42_PM.png

        • 1. Re: Edit box that will auto paste with timestamp and username.
          philmodjunk

               It looks like you are trying to put a series of timestamp, author identified notes into a single text field. While that is possible, I don't recommend that approach. Use a portal of related records with one record for each note. Your script can move data from the current edit box into a new record in this portal so you can still lock down the data from future editing. And i'd set up two separate fields in this table that auto-enter account names and dates instead of including that data with the note in the same field. It makes it easier to sort and search for notes by date and author when the data is in fields set up for that purpose.

          • 2. Re: Edit box that will auto paste with timestamp and username.

                 Paul,

                  

                 You could setup your script to execute OnObjectExit or OnObjectSave on the NotesEditBox.

                 If IsEmpty (NotesEditBox)

                      Exit Script

                 Else

                      Set field [ Notes ; Notes & "¶¶" & "NotesEditBox¶" & Get (Current Timestamp) & ", " & Get (AccountName) ]

                 End If

                  

            • 3. Re: Edit box that will auto paste with timestamp and username.
              paul350passaic

                   Thanks Phil and Bill. I used both of your idea and made my own modification. I used most of Bill's script:

                    

                   if [IsEmpty (Update::NotesEditBox)]

                          Exit Script []

                   Else

                          Set Field [Update::Notes; Get(CurrentTimeStamp) & ", " & Get (AccountName) & "(the line down symbol)"  & Get (ActiveFieldContents)]

                          Clear [Select; Update::NotesEditBox]

                   End if

                    

                   Im just missing the part where Phil mentioned about creating a Portal row. Although it locks down the entry for each portal row, I dont think Portal will work because some update or entry can be as long as 20 sentence and some can just be 2 words. Unless the Portal field will shrink or expand depending on how long the entry was. So As Phil mentioned I am trying to "put a series of timestamp, author identified notes into a single text field". Will it make it complicated to use one field instead of portal row? and if Portal row is the only solution, Is there a way to accomodate different length of entry for each portal row?

              • 4. Re: Edit box that will auto paste with timestamp and username.

                     Here is a screenshot of one of my solutions that work the way Phil described.

                     We enter our notes in the Contact Notes field, and hit the green "+" button.  That moves the data from the Contact Notes field to a new record in the Request History table.  It also stamps date, time and user name fields in the Request History table.  If you have a lot of text in the Notes field in the Request History portal, you can click in the field to expand it and scroll.

                      

                • 5. Re: Edit box that will auto paste with timestamp and username.
                  philmodjunk

                       Yes, but I don't recommend that you put the additional data, the date, time and author in the same field as the notes text. Separate fields in the same table can auto-enter this data automatically when the record is created. And with the date, author, etc data in separate fields, it becomes a simple task to find, sort or filter notes records by this information.

                  • 6. Re: Edit box that will auto paste with timestamp and username.
                    paul350passaic

                         Thanks Phil and Bill,

                         This works for us.