You can try using Export/ Import with update for that record.
You can load the data from one record into a set of variables and then use it to update the second record
Also, you can create a temporary relationship between two records, so you can see the values of the first records fields when you are on the second record
You can also use ExecureSQL to access the other records values
No, you don't have to do an export / import (although that would probably be fastest). You can create a relationship between the two tables via a global field in table "A", set to the unique ID for record "B". (This is usually referred to as a "self-join" or a "self-joining relationship.)
Then, simply use a series of Set Field commands to move the data across. For a higher level of sophistication, you can use the FieldNames function to fetch a list of fields on the layout, loop over the list, test each one using Evaluate to see if it's non-blank, and then use Set Field by Name to move the data across if it's not.
Another method would be to set a series of variables in record "A" equal to the non-blank variables you want to pass (and their field names). Then switch to record "B" and, again, use Set Field by Name to set all the fields.
But again, an export / import is most likely faster and less trouble to code.
Here is where I am.
I have created a "New" holding table to hold the contents of fields I want to copy from record A in "Original" table to record B in "Original" table. I have created a layout that accepts two numbers, A-Unique-ID and B- Unique-ID, and has a button to launch a script.
I'd like that script to bring focus to Record A in "Original" table, set the values in holding table to the values in the corresponding fields of Record A, then shift focus to Record B and set the field values to those in the corresponding holding table. I am stuck on that script. I thought I could use Find but can't get it to work.
When you ask for the help with a script, it's worth posting a screenshot of the script. At the moment we only know what you "stuck", so advise would be to "get unstuck"
It looks like you ignored mine and Mike's suggestions and carry on what you tried to do before. It is an awkward way of doing it and it could gone wrong in a few places. It is difficult to say without looking at the file. If you can recreate what you are trying to do in a sample file and post it, we could try to help you tracking the problem
Did not mean to "ignore" what you two wrote; more likely I did not understand it.
I have posted very small sample database here: SugarSync
How would you go about scripting to give a user the option of overwriting First Name & Last Name fields in record with Contact-ID "X" with Record "Y" as arbitrarily entered by user in a custom layout?
Your file does not have a script or relationships, so I can't tell what was wrong.
I added two sample scripts to demonstrate updating through variables and updating through self-join.
The file is attached to this post
Thank you, thank you thank you!
The self-join did the trick--and taught me a new trick. Also, I haven't scripted since FM7 and variables came in with FM8, so that was a welcome lesson, too.
I hope I can help you someday.