The solution to this is to learn string manipulation and concatenation, and how to deconstruct a timestamp using time.
If the_field contains a string and you prepend two pilchrows ¶ it forces whatever the contents of the_field were down two rows.
So Set Field ( the_field ; "¶¶" & the_field ) will drop the contents of the_field down two lines.
This calc will get you the timestamp as text with seconds removed.
_ts = Get ( Currenttimestamp );
_h = Hour ( _ts ) ;
_m = Minute ( _ts )
Left ( GetAsText ( Time ( _h ; _m ; 00 ) ) ; 5 )
Not tested when hours is less than 10 or minutes is less than 10
I must be missing something. I can get it to skip the line but the problem is it keeps going to the end of the field. I need it to start at the beginning. That is where I am having trouble. I need the info to look like this
username timestamp - this is the third note
username timestamp - this is the second note
username timestamp - this is the first note
essentially he wants to click a button and it start the new note information by moving everything down and inserting username timestamp -
(I would prefer to have separate records for every note)
you can use coherentkris' forumula, just change the calculation part of the 'let' to something like
get(UserName) & " - " & _h & ":" & _m
instead of the 'left...'
to have it step by step, just create a var with kris' formula (altered)
set variable ($MyVar; kris_formula)
set field (MyField; $MyVar & "PP" & MyField)
PP stands for the two pilchrows, You set the note field to the new header and the contents of the note field. The script might need to set the cursor as well, might be different if the note fiekd is empty (first note), etc.
Sorry about the late response but i eventually found the perfect solution it is as follows
Set Selection [Customer::Notes ; Start Position0; End position0 ]
Insert Text " press enter twice or 2 ¶ "
Set Selection "Same as before"
Insert Calculated Result "turn off the select entire contents"
Here is my calculation "--- " & Get(CurrentDate) & " @ " & Get(CurrentTime) & " by " & Get(AccountName) & " ---¶"
Example of the notes field will look like so:
--- 2/3/2016 @ 1:45 PM by Your User ---
This is the note part the user would write
--- 2/1/2016 @ 2:00 PM by Your User ---
This would be an earlier note
I attached this script to a button and it works great!!