Jump to content
Sign in to follow this  
lpm

Copy/Paste no more?

Recommended Posts

Copy/Paste was used a lot between files in FMP<7. What is the best way to "copy/paste" values between tables in FMP8? Is it Set Field? tia

Share this post


Link to post
Share on other sites

Set Field[] should be used for setting field values. In FM8, Set Variable[] can be used for holding temporary values accessible within the same file. Variables can take to place of globals for a lot of temporary values like loop controls. For passing values to other files, script parameters can be used.

As an example, if you wanted to set the foreign key in a new line item record based on the primary key in the parent table, it might look like this:

Set Variable [ $key ; Parent::RecordID ]

Go to Layout [ line item layout ]

New Record/Request

Set Field [ ParentID ; $key ]

...

In any case, Copy/Paste should definitely be avoided.

Share this post


Link to post
Share on other sites

It have hardly ever been fully embraced, since it tampers with the users clipboard, therefore were measures earlier instated to save what the user might have stored there and rebuild it after the dealing was done. But not all gestures could survive such dealings eventhough the measures were there in the scripts.

One diehard use of Copy/Paste was to gather ID's of a found set, but very much to our luck have several methods lately cleared this nasty spot:

http://www.filemakerpros.com/GetNthRecordTAIL.zip

...the only real use is down to the eminent speed copy/paste still has to offer compared to the other methods, but still keep away from it by all means.

What is the best way to "copy/paste" values between tables in FMP8

No it's not Set Field, but instead a normalization of your structure to prevent the syncing issues a copy always will exhibit, database ideals seek to store data in only one position, and if you should need to show it somewhere else is it done by referencing and certainly not by having a copy to freshen.

--sd

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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