On 2014 Mar 2, at 7:12, Peter Buchanan <[log in to unmask]> wrote:

Hi John
 
I have two tables, Voyage (parent) and Ports (related records).
 
For each voyage, user creates portal records,  entering a port name and number of days in each port. A departure date (calculation field) = number of days plus arrival date.
 
Arrival date is the departure date from the previous record in the portal. Except in first record, where user enters a date.
 
I run a loop script to set the arrival date into each record. GTRR, go to first record, set departure date to a variable, go to next record, apply variable to arrival date field etc.
 
I am trying to trigger the loop script when the user exits the portal, instead of having to click a button on the layout to recalc the dates.
 
Regards
Peter
 


You could have a button on the main layout called something like "Begin New Trip", and when the user clicks on it, it brings up a custom dialog box saying "Enter Date on Which the Voyage Begins", with an input field that will accept it in the specified format. Then, after the user has done that (and you've trapped for date validity), he or she clicks "OK" (or hits "return"), and the underlying script takes over from there, all the way thru the rest of the process, returning you to your main screen, newly refreshed, at the end of it.

Or, if you're trying to avoid buttons, you could just have the script set off directly from the Scripts menu or the appropriate shortcut key.