Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5027 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

6420e5454daa687c58f525f4ec7b7808b39ba0b9

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.

Posted

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

Posted

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.

78b31d413bb6bdca5dc6f8c28fab24d18f6683c7

Posted

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.

This topic is 5027 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.