Jump to content

Duplicating All records from found set


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

Recommended Posts

I am trying to set up a step by step training manual for my cabinetshop. Some of the things we build use essentially the same steps as other things we make. I would like to be able to develop a task list for one product then use that same task list again for something else.

[color:red]I would like to start from a FOUND SET then duplicate just those records with a script.

Can somebody suggest a way to do this?

Thanks,

Jarvis

Link to comment
Share on other sites

Hi Jarvis!

Try:

Go To Record/Request [ Last ]

Loop

Exit Loop If [ not Get ( FoundCount ) ]

Duplicate Record

Omit Record

Omit Record

End Loop

... if there are things you want to do to the new record, insert those lines immediately after the Duplicate Record. The set should not be sorted ... if sorted, it will slow the script down. And back up first. If you need to preserve the newly created records in a set, let us know and it can be adjusted but I usually take care of the new record's needs immediately while ON it.

BTW, some people recommend exporting then importing the set. But each time you move data out then back in, you risk error.

Edited by Guest
Link to comment
Share on other sites

Thank you LaRetta.

I'm sure I could have stared at this problem for a million years and not got around to the [not Get (Foundcount)] part of the incantation. I don't know what that does but I will take it on faith because it seems to work.

I would like to be able to act on the created records as a set (distinct from the rest of the database) Do I need to burn incense while running the first script to make this happen, or is there another way to keep these newly duplicated records up on deck?

Thanks again,

Jarvis

Link to comment
Share on other sites

It isn't as pretty but no incense required. You must sort your set. Sort by something unique like the ID - because if you sort on a field with two identical values, it will probably mess you up. The reason is that we need the newly created duplicate to appear immediately below the record it duplicates (so we can isolate it). And we'll need to start at the top. Why? Because FM did not think through the logic of their 'Exit After' checkbox and - on Go To Record/Request [ Previous ], they only allow 'Exit After LAST' when they should have allowed Exit After FIRST. // endRant

Sort Records [ without dialog]

Go To Record/Request/Page [ First ]

Loop

Duplicate Record

Go To Record/Request/Page [ Previous ]

Omit Record

Go To Record/Request/Page [ Exit After Last ; Next ]

End Loop

Oh. In the first script, not Get(FoundCount) means no records left to process and tells FM to exit the loop if there are no more records. :wink2:

Edited by Guest
Reworded some of it
Link to comment
Share on other sites

This topic is 6459 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.