It would be helpful to describe in more meaningful language what you are trying to do, and especially - why you think you need to duplicate information.
(Not field A, field B etc)
In general, this is why we have relational databases; so you do NOT have have duplicate values. Instead, you have one instance of the values and a relationship that lets you see those values in other contexts.
But - to more directly answer your question, it DOES have something to do with set field; but also with capturing the original values before you change context. Example:
Set Variable [ $firstname; contacts::firstName]
Set Variable [ $lastName; contacts::LastName]
Go to layout Book Club members
Set field [ Member::firstName; $firstName]
Set field [ Member::LastName; $lastName]
Okay, the need for duplicate information comes from Layout B not ALWAYS needing to be filled with the fields from Layout A. In fact a lot of the time it won't be used but having those four (for the moment) fields pre-populate is a great way to identify which record the other data (input on Layout B) belongs to. For whatever its worth, Layout B is purely a table whose data are exported to an Excel file which is then used to populate the merge fields in a Word Doc and elsewhere in the program, those fields aren't used. Unfortunately, Word for Mac 2011 is not compatible with FMP13... would have been good to know ahead of time but whatever.
All that said, I tried using the Set Variable option you recommend and it's working perfectly. I did elect to use double $$ so that it was global (can't hurt!) and because more $$ is better than $. (Grin)
It is also possible that instead of copying over the names, you may need to link the new record in layout B's table to the current record shown on Layout A's table.
Once the link is established, you can access all data in that record on Layout A, either to copy it into fields of the new record or to display it on the layout as though it had been copied.
For more on the copy vs. link process: Auto FillCaulkins Consulting, Home of Adventures In FileMaking
Yeah, and the more I look at it the more I can see the purpose in linking these two. Not for the immediate purpose so much as the down-the-road record keeping one. I'm new to this though and starting simple is where my playground is.
Clicked the wrong "best answer." Don't know how to change it. Bruce Robertson wins this round though. With Phil Mod Junk coming in a close second for philosophical reasons.
Okay, the need for duplicate information comes from Layout B not ALWAYS needing to be filled with the fields from Layout A.
That simply means that you need to link SOME records from Layout A's table to a Record in Layout B's. It does not mean that you need to copy over the data.
Global variables are useful in their way but they CAN hurt and should generally be avoided, in favor of script variables.
Gee, when did I last set that $$value? Is that really the current value? Did Script X set it or script Y? Did I set that an hour ago? Oh wow man I don't remember!
Script variables clear themselves after that script runs.
Two other important and related features to learn about are script parameters and script results.