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

Duplicating layout and record


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

Recommended Posts

Posted

I'm trying to copy a layout, call it layout A, including the records to be copied to another layout, call it layout B. I need to have all the records, fields, content, and everything in layout A to be in layout B. so layout B should be exactly the same as layout A. there are about 4000 records in layout A and i'm not familiar with scripting, what is the best way to duplicate the layouts? i could only copy the layout but none of the contents get copied over. any suggestion is much appreciated!

-pokeguy

Posted

I take it you are talking about two files? If so, just 'Save a copy as'. Otherwise just import the records from A to B.

Posted

i want to move a layout, including its records and content, from one file to another file. so now file A and file B will have the same exact layout with records and everything the same. sorry if i was misleading. Thanks!

Posted

Hi Pokeguy, and welcome to the forum.

I think what is confusing, is your description of what you want to do. For clarification, are the two layouts going to reside in the same File (i.e. Contacts.fp5) or in different files such as Invoice.fp5 and Line Item.fp5?

Lee

Posted

Than save a copy of the one and rename it, Bingo, you have two files that are identical.

Posted

Well then you're going to need to add all the necessary field definitions to your second file, then select all objects in Layout Mode, copy, then paste into your new file, verify the fields are all the same, then import all records from your first file. Much easier to copy the file and make the changes you want.

Posted

If all of your Fields in File A already exist in File B, then all you would need to do is to copy your layout and paste it onto a layout in File B. You can do this in Layout Mode in both File A and B.

The easiest way is to create a blank layout in File B, and then Select All in File A and Copy. Go to the Layout in File B and paste.

To move the records, first isolate the ones you want in File B in File A, and then, In File B, you can import the records from File A.

If you need help with any of the steps, either come back to us, or use the Online Help in FileMaker or RTFM

Lee cool.gif

Posted

Hi JT,

It won't be hard to post back faster than me this week. laugh.gif My grandkids are here and I keep getting interrupted.

Lee

P.S., I'll leave my post however, I need the count because, you are getting too far ahead of me.

also, I got logout in the middle of all of this. wink.gif

Posted

Haha! And I wasn't even around here much yesterday. You need to push harder on days when I'm absent. wink.gif I would think that having grandchildren around would be a more rewarding experience than post-racing with a virtual personality anyway. boing.gifhairout.gifjester.gif

Posted

We have a few hundred fields now, and that we can tell we have to define each field. Is there an easier way to do this so we can copy the records into this new thing?

Posted

aren't there scripts that "copy" all fields from one file to another? with that many fields, it'd take a long long time to sort through the list to match up with where the fields are located. is there anything besides manually added the fields one by one?

Posted

Not unless you use some sort of plug-in perhaps. It's much easier to duplicate the file and make your changes. I've had to rebuild a file from scratch before, and match up the fields as you indicated. It's a pain in the neck, but sometimes you gotta do what you gotta do.

Posted

How about creating scripts to copy some fields from 1 record in file A, to some some fileds in record B?? I have been trying, and managed to get one funtion that works some of the time and not the rest....surely it should be possible to just hit a button and update the related file...? confused.gif

Posted

Use Set Field [relationship::fieldX, fieldY] for each field that you want to update, where relationship is a unique relationship from fileA to fileB.

Posted

...not if you want to change fields in the same record.

e.g.

Set Field [relationship::fieldA, fieldB]

Set Field [relationship::fieldB, fieldC]

Set Field [relationship::fieldC, fieldD]

will change fieldA, B, and C on the same record in the related file.

  • 3 months later...
Posted

....several months later....Ok so I'm back with another challenge!

related to the above...

I am trying to write a script to copy certain fields from current file to cerain fields on several newly created related records....

I have so far successfully created a script to create the new records depending on a number in a field as to how many records it creates. I then want to copy the same data several times (i.e. once to each new record)in the related file, and have a number from 1 to how ever many in the related file for that particular copy operation.

the problem i am finding is that to get a working relationship for this, i seem to need to manually add in a value to a match field in the new record....at times there may be as many as 60 new records at a time...so i want even that "ID" to be automatically copied....

in case it helps....the application is for designing audio wiring for recording studios:therefor some equipment may have 60 "channels" with the same function, but a different "channel" number.

...anyway...I will keep working on it for now...and look forward to any feedback

Posted

I would have the new records auto-entered with, say, 1. Then use a relationship from the first file, which has a calculation or auto-enter of 1, to the auto-entered field in the second file. A script can set related fields and then change the auto-entered field so that it no longer matches. When the relationship is next referenced, it will be associated with a different record. Your script would look something like:

Loop

Exit Loop If [isEmpty(relationship::serial)]

Set Field [relationship::field1, data]

Set Field [relationship::field2, data]

Set Field [relationship::field3, data]

Set Field [relationship::auto-enteredfield, ""]

End Loop

  • 4 weeks later...
Posted

....thanks very much for the above technique ....I am using it over & over at the moment.....really saving me hours of drudgery!

....by the way....do you happen to know if there is a way (in fmp 5) of using the "set field" comand on repeating fields....(i.e. set repetetion 1 etc)

I have tried the "current repetition number" function with no joy...

anyway....i have a work around if not....

thanks again for the top tips!

Posted

When you specify the target field in a Set Field step, change the Repetition box from 1 to whichever rep you want.

Posted

...oh thats what that "specify" is for....!

...well, that was a bit unchallenging for you...so here's a couple of other

repeating type things...1)is there a way to get a calc field to return a value equal to the number of reps of a rep field that have data(I've tried this one for a while but no joy...)

..2)is there a way to get a related container field to display as a repeating field, (with different contents in each rep)...so far I have had to resort to lookups instead, but this is making my file size a bit bloated!

....p.s....i tried to post a reply a few minutes ago, which i think i must have aborted by accident...but if another appears, you'll know why...

....again, many thanks for any input you are able to offer..

Posted

1. Count(repfield)

2. Is your related container a repeating field? Or are you wanting to display different related container fields in each repetition? If so, you can create a global repeating field and populate it with 1 in the first rep, 2 in the second rep, etc., and then define your calculation as Choose( globalrep - 1, rel::container1, rel::container2, ... )

Posted

...again many thanks....

you wouldn't believe the complex calcs I tried for the count(repfield) thing...

...and there it was under my nose all the time!

.....with the second question, I think your second sugestion sounds like the one, and hopefully i have understood the theory....I'll let youk know later...

...oh yes...which table would the global field be in...the related file i presume (where the graphics are located)..?

Posted

...i've not quite got it...

just to clarify: currently i have a graphics file, with little more than a container field and a match field, & about 20 records with different graphics.

Then in the main file, I have a repeating container field that currently looks up the graphic (repeating horizontally accross the page) & under that a repeating match field with a drop down value list from the match field of the graphics file ...

....so what i dont quite get, is how & where i would layuout the global field,

and where would the calculation go...& where would the related graphic end up displaying?....

....also, i need to display different combinations of the graphics(accross the repetitions)in each record....

....I hope that paints a clearer picture of what i am trying to achieve...& hopefully what you are suggesting will work....

....manrwhile I will continue to try to get my head round what you've already explained....and many thanks again.....

Posted

So, your graphics file contains 20 records with a different graphic in each record and only one container field? I thought you meant you had a container field for each graphic, which would make it easier.

It might help if you posted the two relevant files, so we don't have to guess what each other is talking about. wink.gif

Posted

....thats a good idea. I will post just the 2 files in question & hopefully the lack of other related files wont cause it to missbehave!

.....maenwhile I will try making the graphics file repeating containers instead of seperate records...

...again many thanks

VortexPatchHoles.zip

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