November 13, 20196 yr 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, 20196 yr by cterrell16
November 13, 20196 yr 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.
November 13, 20196 yr Author 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.
November 13, 20196 yr 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.
Create an account or sign in to comment