Copy and Paste Setup Forms

You may encountered situation when you are working on the development branch and yet have to add some stuff into production database. In order to keep changes in production database you can either drop the branch or carefully copy and paste object settings from production to branch, property by property. But there is the easiest way – two buttons that allow to copy and paste setup forms. These buttons are displayed at the top right corner, when you edit any database object (view, column, trigger etc) in the Setup mode.

Let’s consider an example, when you need to Copy/Paste settings from one View to another.

Firstly, open the edit form of the initial view, let’s name it “Enabled Records” view. Then click on the Copy Form Data button.

Copy Form Data.png

Upon clicking the Copy Form Data button about 300 lines of nicely formatted JavaScript will carefully iterate over each editable control and its state to the clipboard.

After that you may edit the other object. In our example - the other view. Let’s assume that you created a new view.

So, on the edit form of this New View, you should click on the Paste Form Data button displayed at the top right corner of the form.

Paste Form Data.png

After the clicking the following window will be open:

Paste Window.png

Now you should paste the copied code. You may do this using the Ctrl+V combination or clicking on the right button on the mouse and choosing the Paste option in the displayed menu.

Pasted Code.png

As the result, the code will be pasted. 300 lines of code will do the following – find appropriate control and restore its value, emulating typing, selecting, clicking and checking as necessary.

After the clicking on the OK button, the changed form will be shown:

Changed New View.png

You can see that the form of the newly created View is identical to the initial “Enabled Records” view. Even the View Name is the same. It is handy when you need to copy/paste object forms from Development Branch to production database.

Now you may save the changes.

In fact you are not restricted to Production/Dev.Branch pair. You can try to copy everything everywhere as long as objects have common properties. And almost all of them have at least name, notes and help text.

Suppose you decided to visualize your summary view’s data via chart view. These two view types have quite a lot in common. You can simply copy summary view’s edit form and paste it into new chart view. And then the only thing’s left is to select appropriate chart type.

Or you can try to copy button’s settings into document and vice versa.

Or copy between the database and its modified copy — we’ll do our best to paste as much as possible.

One caveat to mention. At the time of writing only Chrome browser supports programmatic access to clipboard we need to perform paste. To work around this limitation, for non-conformant browsers have to display a dialog with a text box to paste clipboard data into using keyboard or menu.

Next: All Periodic Tasks