November 3, 200421 yr Hi all: I am using Copy() and Paste() script steps to copy data from one global field to another. For a short while the Paste step would paste whatever old data I had lying around on my clipboard, regardless of what field was Copied. Now it appears to be pasting nothing at all. I have debug statements placed to show the value inside the global to be copied, and it shows correct data, but how can I (if at all) debug/output what FM has placed on the clipboard with the Copy step while inside a script? Thanks Kurt
November 3, 200421 yr Use Set Field instead of Copy/Paste, unless you are copying and pasting all records. Then this won't even be an issue. Globals are accessible from any table, regardless of whether a relationship exists between them, as long as there are TOs for them in the relationships graph. So Set Field [table1::global1; table2::global1] will work even when table1 and table2 aren't related.
November 3, 200421 yr Copy and Paste are also layout-dependent: the target fields must be on the current lauout at the time the steps are invoked, otherwise they fail. Set Field has no such problem.
November 3, 200421 yr Hi Vaughan, Copy and Paste are also layout-dependent: the target fields must be on the current lauout at the time the steps are invoked, otherwise they fail. To add to this a little. While It is true that your script has to go to a layout where your Copy Field resides to "Copy", and then it a Layout where your Paste Field resides to "Paste", the user doesn't have to watch it do it. All you need to do is to use the Freeze Window Script Step before you start it on its journey. However, the Set Field is a better way to do this 90% of the time. HTH Lee
November 3, 200421 yr Author Thanks to you all for your replys. I am indeed copying from one layout before moving to, and pasting into, another, so that is covered. I didn't know about the 'Freeze Window' command but know I will be using it now! I normally use Set Field in my scripts but was under the impression that it wouldn't work in Find Mode. I don't know why I thought that but will certainly give it a go. Thanks Kurt
Create an account or sign in to comment