Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Copy and Paste Script

Featured Replies

I have two files. I would like to copy and paste data from three different fields from file A to File B. I have created a script that will copy the contents of one field in file B then open file A. Then I past this data into the file A field. Now I have to manually go back to the file and do it again. Is there a script that will allow me to copy and past three or more fields of data from one file to another. I know I can accomplish this by relating one file to another, but I am looking for an alternative. Thanks

If you set up a relation between A and B then you can create three global fields in File B. Use a script to copy the information to the three global fields then go to File A and use Set Field to "copy" the information.

HTH

Hi Bob,

Is there a specific reason to avoid creating the relationship? In most cases it should simplify your solution.

There are good reasons to avoid using Copy/Paste. For instance, when you use the clipboard to move data, you will be eliminating anything that is already in the clipboard. Users cannot generally tell that your script is doing that, and if they manually use Copy as well, you will be deleting their data. They may be unpleasantly surprized when they next try to Paste.

Good luck!

Bob Weaver provided this answer some time back on how to avoid dumping any user clipboard contents, if you are using copy/paste in scripts. I thought it was pretty neat !

"There are one or two situations where you can't avoid using cut and paste, like when you are setting up a date range for a find operation. In these situations, you can preserve the contents of the clipboard at the beginning of your script, and then restore it when you are done so that the user doesn't lose the prior contents. Here are two scripts that save and restore the clipboard.

code:

--------------------------------------------------------------------------------

# This sub-script saves the contents of the clipboard.

# The clipboard layout contains the fields gClipboard1 and gClipboard2

Go to Layout [Clipboardlayout]

Clear [gClipboard1]

Clear [gClipboard2]

# gClipboard1 is a global text field which will save the clipboard contents if it happens to be text

Paste [gClipboard1][select all]

# gClipboard2 is a global container field which will store everything else

Paste [gClipboard2][select all]

Go to Layout [original layout]

--------------------------------------------------------------------------------

code:

--------------------------------------------------------------------------------

# This sub-script restores the contents of the clipboard.

Go to Layout [Clipboardlayout]

# Determine whether the saved clipboard data is text or other, and restore accordingly.

If [not IsEmpty(gClipboard1)]

. Copy [gClipboard1][select all]

Else

. Copy [gClipboard2][select all]

End If

Go to Layout [original layout]"

  • Author

That's great. Thank you.

  • Author

Thanks for all you help. I ended up bringing the information over into a portal and creating a script that would copy the information from the related field to in the portal to the field in the primary file. This allowed me to then create a portal in my urchase order that display the data from my primary file.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.