I would not insert Username, time and date all into the same field. I'd insert the username into a text field and the date/time into a timestamp field. And in some cases, I might even insert date and time into separate date and time fields.
Set field [ YourTable::userName ; Get ( UserName ) // but you might want, instead, to use Get ( accountName ) ] **
Set Field [ YourTable::Timetampe ; Get ( CurrentTimeStamp ) ]
And you may find it useful to set up auto-enter field options on these fields such that this data automatically entered into each new record. Then simply creating a new record enters this data and no script or button is required.
**A User name is specified in preferences. An Account name is specified in Manage | Security. One is often confused with the other but they are not exactly the same thing.
Thanks for the quick reply.
The solution you propose means adding a few new fields into my tables if I'm interpreting it correctly.
The data I need is just going to be used to insert text into a 'Notes' field which already has other information contained within it. For example when we get a phone call we can update the notes field with time/day/user and a quick note about what the customer has told us on the call. The 'Notes' field is shown on our main customer layout which could be on the screen for a few hours at times. If I did an autocalc when the layout is displayed the time would be out when the script is invoked.
The solution, based upon the Get commands you provided above works perfectly (see atttached)...
Many thanks for your help...
Yes you will need to add more fields, and possibly a whole new table.
By keeping the data in separate fields, you gain the ability to sort and search your notes by date and by name in ways not possible when you insert multiple items of different data types into the same field.
In some cases, this method is used to record multiple notes into the same text field--which is even worse as you then lose a great deal of flexibility in how you can work with such data after it is entered. A related table of notes with at least 4 fields: Name, timestamp, note text and foreign key to parent table is many times more flexible and yet, if you set it up correctly on your layout offers very little change in the look and feel for your user.
And I make it a habit to avoid using script steps that start with "insert" unless that step is truly necessary. Those steps are much more vulnerable to "breaking" due to future layout modifications than using Set Field and it can also be used to insert a name and timestamp into your field--though I recommend against doing that.