It could be that the source field for "copy" is empty and is therefore pasting nothing. This is just one of the many reasons to avoid using copy and paste in scripts. With the ability to pass optional script parameters and create variables, coupled with Set Field, it really is a good idea to avoid using the clipboard. Another example would be having FM running a script, perhaps a scheduled script, and you're working on a text document in another application. Copying and pasting is very common when working on text documents. So you copy a phrase to the clipboard and a second later FM uses the contents of the clipboard to paste . . . not good! Someone here said "leave the copying and pasting to the user" and keep it out of scripts whenever possible. I believe it's always possble.
In addition to Rick's good input, the primary reason a paste script-step could fail is that it requires that the field be on the layout. Set Field has no such requirement.
Thanks for your good advice. Set Field only works with related tables, correct? I'm trying to get info from a table to an unrelated table. I figured out why it wasn't copying and pasting - There were some script errors (set fields with no relationship) so it skipped the copy and paste commands for some reason. I'm going to post my bigger problem so I can, hopefully, omit the copy and paste steps.
The values should be stored temp in a variable. The script would be like such:
Set Variable [ $FirstName; FirstName ]
Set Variable [ $LastName; LastName ]
Go to Layout [ LayoutofOtherTable ]
Set Field [ FirstName; $FirstName ]
Set Field [ LastName; $LastName ]
You can go to a layout of the unrelated table.
Thanks! Maybe this will solve my problem! Fingers crossed.
I know just enough to be dangerous.
Thank you for your help. With a lot of careful thinking and using the set field instead of pasting, I was able to solve my problem. I think I had a complex problem - I wanted to create a new job and a new invoice at the same time, see them both on a portal, then switch to a detail tab that contained more info about that particular job in the list. I was able to do it on one layout where I only needed to create one thing but adding the new twist of creating something else was hard for me.
But the SET FIELD worked perfectly!