John Mulholland Posted July 27, 2006 Share Posted July 27, 2006 I have two scripts - the first script should store the current recordid and then performs a script which should finish by returning to the originating record. I thought recordid would be the safest way to do this as it would avoid any complications with found sets etc. The scripts look like this: Script abc Perform Script ghi Parameter Get(RecordID) Script ghi various actions Go to Record/Request/Page [get(Scriptparameter)] When the scripts run, recordid 448 is correctly passed from abc to ghi but within ghi when the "go to Record" executes I get an error saying that 448 is outside the range of records in the database (there are only 360 records) saying that I should specify a value between 1 and 360. How can I get the 'go to' to use the recordid. Quote Link to comment Share on other sites More sharing options...
Ender Posted July 27, 2006 Share Posted July 27, 2006 Hi John, The calc in the Go to Record/Request/Page [] script step is meant to return a record number (or request or page number), so the script step can jump to that record. If the calc returns 448, the script step wants to jump to the 448th record in the found set. There are a couple techiniques to return to a previous record. The one I like is a Go to Related Records[] script step. This requires a self-join relationship from a globally stored ID field to the RecordID field for that table. Another techique is to not change the found set in the original table at all, and use a New Window for running a report or whatever process you're doing. Or you could go old school, and use a Find to find the record with the stored ID. There's another cool technique using Go to Related Records[] script steps that keeps the found set and the sort order intact. It's hard to explain, but you can check out the attached demo. Quote Link to comment Share on other sites More sharing options...
Ender Posted July 27, 2006 Share Posted July 27, 2006 BTW: Get(RecordID) should not be used here, since you'd need a field for the relationships used by the GTRR steps, and Get(RecordID) is not a good way to populate your relational keys. Instead designate a field in each table to be the RecordID, and give it an auto-enter serial number. Use this RecordID field in your relationships. Quote Link to comment Share on other sites More sharing options...
John Mulholland Posted July 28, 2006 Author Share Posted July 28, 2006 Many Thanks Ender - that got me on the right track. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.