cterrell16 Posted November 13, 2019 Posted November 13, 2019 (edited) I'm trying to find out how to apply a time stamp to all the open records being browsed when I run a script. Currently I search all my invoices for items that have not been payed. I then hit a button to run a script to email all open invoices. A time stamp is added to show that it has been emailed. Right now my script only applies the time stamp to the first record. All are being emailed however. Any ideas or help how I can get the time stamp for all the records being emailed. Script calculation is below: Insert Calculated Result [Select; Invoicing:: Emailed Timestamp; Get (currentHostTimeStamp)] Go to Layout ["Invprint" (invoicing)] Save Records as PDF [Restore; No dialog; "Invoice.pdf" records being browsed] Send mail {send via email client; To: customer file::invoiceconfirmemail; Subject, etc....... Go to layout [orignial layout] Edited November 13, 2019 by cterrell16
comment Posted November 13, 2019 Posted November 13, 2019 Insert Calculated Result[] works in the current record only. If you want to modify all records in the current found set, you need to use the Replace Field Contents[] script step instead. Or loop among the records and modify each one in turn. Note that both methods can fail if one or more of the records are locked by another user. You may consider an alternative of creating a new record in a mailing table, with a timestamp field and a list of invoices being mailed.
cterrell16 Posted November 13, 2019 Author Posted November 13, 2019 I should not have anything locked since there is only one person using the invoice system. Can you give me an example of how I would use the replace field contents method in my current script. I had tried that before but I could not mange to make it work.
comment Posted November 13, 2019 Posted November 13, 2019 Not sure where the difficulty lies. Add the script step to your script. Select the Emailed Timestamp field as the target field, then choose 'Replace with calculated result' and enter Get (CurrentHostTimeStamp) into the 'Specify Calculation' window.
cterrell16 Posted November 13, 2019 Author Posted November 13, 2019 I was able to make it work thanks to you. Thanks so much.
Recommended Posts
This topic is 1848 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now