2 Replies Latest reply on Sep 17, 2015 9:44 AM by Mike_Mitchell

    Insert date and username

    Gerrly

      I have a text field where a lab director enters his/her comments.  I would like that when the director types in this field, the date and username automatically populate in the respective fields above the comments (circled in screenshot).  I'm thinking I will need to apply some sort of trigger to the comments field, but I don't know what I would write.  Thank you in advance.

       

      Screen Shot 2015-09-17 at 12.04.02 PM.png

        • 1. Re: Insert date and username
          Markus Schneider

          set the date-field to auto-enter (date) and the user-field to auto-enter (account name, what ever fits best). These settings are under manage database, field, options

          • 2. Re: Insert date and username
            Mike_Mitchell

            You don't need a trigger. You can do this with an auto-enter calculation. Go to File > Manage Database. Select the Director Date field and click "Options". Click the "Auto-Enter" tab (if not already selected):

             

            dialog.png

             

            Click the "Specify" button next to "Calculated value". Enter this calculation in the resulting dialog:

             

                 Case ( not IsEmpty ( Director comments ) ; Get ( CurrentDate ))

             

            Leave the "Do not replace" checkbox checked.

             

            You can perform a similar operation for User. Just substitute Get ( AccountName ) for Get ( CurrentDate ).

             

            HTH

             

            Mike