Ditching Finds and Using GTRR InsteadPosted: December 8, 2011
In the past, when selecting items from a list in order to do, say, a mail merge or some other sort of bulk processing, I’ve used a clunky combination of “select” indicators on each record, followed by a Find finding all recs with the selection indicator set), then a loop through the found set.
Having realised the error of my ways, I now use the technique described in “Selecting Items from a List“, which basically puts the primary key of each selected item in a global variable (say “$$SelectedPeople”), using a neat custom function to toggle between selection and de-selection.
Once the global variable is set, getting the records for bulk processing is embarrassingly simple – just bung the contents of the variable into a global “match” field on the table you’re interested in, and do a Go To Related Record.
Within the GTRR script step, having checked that there are people selected, you can specify:
- the layout to be used (in this case a letter template for mailmerging),
- whether to use a new window,
- which records to show – in this case, of course, only related records.
And that’s it. One script step to replace a clumsy sequence.