Do you want the new text to precede the old, or to follow it?
One way would be to use a button action:
Set Field: yourField ; yourField & "¶" & Get (CurrentTimeStamp) & " " & Get (AccountName) & "¶"
It would probably be better for the user if you then put the cursor on the blank line below the time stamp. You will need to script the process to do that.
I would like the text to precede the old information.
So, i'm new to this File maker program. So far I have created a button, but have not set anything to it yet. Can I get a step by step on how to set the button to the script I need to run.
Thanks a bunch
For this particular solution, try creating a script using just the 'Insert Calculated Result' script step. After selecting the script step, you will come across three checkboxes:
1. 'Select entire contents' - check this
2. 'Go to target field' - click on the Specify button and select your Notes field
3. 'Calculated result' - click on the Specify button and then enter the following calculation:
Get ( AccountName ) & " " & Get ( CurrentTimeStamp ) & ¶ & ¶ & Get (ActiveFieldContents)
After you save the script, add a button to your layout and configure it to run this script.
Now, when you click on the button, a timestamp with account name will appear at the top of the notes field with your previous notes listed below.
I hope this helps; let me know if you need further clarification.
Thanks for posting!
Very nice instructions. I love this forum and the support for the software already. Money well spent.
Thank YOU both.
Uh oh. 1 small problem... Once I leave the page and come back and press that button again, it deletes all the content in the box and puts the current time and date stamp.. I would like to keep ALL past communications..
Hmmmmm... that's fairly odd behavior as this should keep all of your notes without any issue. In my database, I can move back and forth through multiple records and retain data when clicking on my button in each record. Is the button tied to a previous script?
Try creating a new button on your layout and have it perform this timestamp script. It may be beneficial to create a new database with a single text field and try running the script there.
Let me know how it works out!
Perfect... Not sure what happened the first time but it is working now.. hehe
1 LAST question.... How do I get the cursor to move to the end of the NEW time stamp with a space between the time stamp so I can just start typing my notes?
This is why I tend to create scripts rather than button that do one script step.
What you need for your button is a script with two steps:
Insert Calculated Result [ Lists::notes; Get ( AccountName ) & " " & Get ( CurrentTimeStamp ) & " ¶¶" & Get (ActiveFieldContents) ] [ Select ]
Set Selection [ Lists::notes; Start Position: Length ( Get ( AccountName ) & " " & Get ( CurrentTimeStamp ) & " " ) + 1 ]
The advantage of using a script is that you can always get it to do other things easily at a later stage.
The only difference I can see is that I modified a bit of the original code:
... & ¶ & ¶ & ...
was changed to:
... & " ¶¶" &
Note the space before the two return characters. This puts in a space after the time as requested.
If that is not the problem, can you say what is going wrong for you?
Edit: NOW I see your error - you have omitted the Length function name in the start position expression ;)
Thanks Again Guys...
I promise 1 last thing.... haha
Now when I click on the button, EVERYthing works great except....... when I have a long list of notes... it always scrolls to the bottom of the box, even though the cursor is in the correct spot. When I start typing the box will then scroll back up to where the cursor is and bring into view what I am typing. I would like the box to stay at default at the very top....
I hope this makes sense... Thanks again!
OK, simple addition to the script - add a Commit Records/Requests between the two existing steps.
See how useful a script is? ;)
Wow... This program is awesome and VERY powerful in the right user hands like yourself! Thanks again for your much appreciated help.
Do you guys know if it is possible to create a mass communication with this same tool? For example, if I did a search for every person in a certain area code and I wanted to create a automatic communication that said I did a mass mailing... how would I go about doing that?