February 17, 201114 yr I have a found set of records and I would like to run a script on each record in turn. The problem is that when the script runs a different set of records is found, I can then return to the original found set but I need to find a way of returning to the record that I was in previously prior to running the script so I can go to the next record and run the script again and so on and so forth. I only want to run the script once for each record in the original found set. Thanks in advance.
February 17, 201114 yr Author Are you really using version 6, as your profile shows? Actually I'm running FM 6 at work and FM 11 at home, although my employer has finally agreed to let me have FM 11. The above query is for a FM 11 database. To be honest, I'd rather use FM 6 than not at all. Couldn't face going back to MS Word & Excel.
February 17, 201114 yr In version 7 and above, you can open a new window, do a find or whatever else is required, then close the window to return to your original record and found set.
February 17, 201114 yr Author In version 7 and above, you can open a new window, do a find or whatever else is required, then close the window to return to your original record and found set. Can opening the new window, doing whatever and closing the window be automated within a script?
February 17, 201114 yr Author Would it be: New Window Perform Script Close Window I have tried the above, but I get an error message because the Perfom Script has to work on the record that I am in within the original found set.
February 17, 201114 yr When you open a new window, it inherits the found set and the current record from the original window.
February 17, 201114 yr Author I imagine I'm doing something wrong. In the above script I'm not sure where to place the New Window and Close Window script steps.
February 17, 201114 yr I don't understand what your script does. I believe the order should be something like: Find the records you want to loop through Go to the first record Loop: Open a new window Do something Close the current window Go to the next record End loop
February 18, 201114 yr Author Thanks comment, the script worked fine except 'update driver history X 1' didn't run for the first record (see below). Didn't run on last record too but I think that's to do with the script step 'Go to next record,exit on last' exiting before 'update driver history X 1' can run.
February 18, 201114 yr You get this error because you have an uncommitted record in the original window. Try committing records before starting the loop. A loop using 'Exit after last' should exit AFTER the last record has been processed.
Create an account or sign in to comment