KurtW Posted November 3, 2004 Posted November 3, 2004 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
-Queue- Posted November 3, 2004 Posted November 3, 2004 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.
Vaughan Posted November 3, 2004 Posted November 3, 2004 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.
Lee Smith Posted November 3, 2004 Posted November 3, 2004 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
KurtW Posted November 3, 2004 Author Posted November 3, 2004 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
Recommended Posts
This topic is 7328 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 accountSign in
Already have an account? Sign in here.
Sign In Now