Automatically updating a field in filemaker

I am creating a subscriptions letter and I need it so that when a letter is printed the entry notes field is updated. I don't want the content in the field erased I just want it added to with something like a line break and then
"22/5/09 six month expiry letter sent."

Is this possible?
jonathan-dunstansAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

North2AlaskaSenior EngineerCommented:
I don't think there is a on printed trigger, so the print process is something you will have to script.  A sample script might look like this:


Print  [ Restore; No dialog ]
#Now loop through each of the found set and update the notes.
Go to Record/Request/Page [ First ]
Loop
Set Field [ table::column; table::column & ¶ & "22/5/09 six month expiry letter sent." ]
Commit Records/Requests [ No dialog ]
Go to Record/Request/Page [ Next; Exit after last ]
End Loop

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jonathan-dunstansAuthor Commented:
Well I would just run it after it has printed as I already have that bit working see code.

In your code am I right in thinking in Set Field the first table::column announces where the information should go and the second gets the information and adds it into the field with the additional in also.

I guess to get the current date as opposed to a recurring 22/5/09 I would just put // as usual?
Constrain Found Set [Restore] //deletes people we don't want the letter sent to
 
Go to layout["letter"](subscribers)
 
Print Setup
Print[restore]
 
code to enter text into notes field goes here
 
 
perform find [restore]

Open in new window

0
North2AlaskaSenior EngineerCommented:
Yes.  The "Set Field" script step accepts two parameters.  1) the field you want to set, 2) the value you are setting it to.  

#2 can be a calculation and in that calculation you can do what you need to add the new comments to the existing comments.  That calc may look a little more like this:
subscribers::notes & ¶ & Get ( CurrentDate ) & " six month expiry letter sent."

Open in new window

0
jonathan-dunstansAuthor Commented:
Thanks it is working fine and dandy now, I really didn't have a clue.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.