Copy and Paste Setup Forms

You may encounter situations where you are working on the development branch but need to add certain elements to the production database. In order to incorporate changes into the production database, you could either discard the branch or meticulously copy and paste object settings from production to the branch, property by property. However, there’s an easier solution available: two buttons that facilitate the copying and pasting of setup forms. These buttons appear at the top right corner when you are editing any database object (such as a view, column, trigger, etc.) in the Setup mode.

Let’s explore an example involving the need to Copy/Paste settings from one View to another.

To begin, open the edit form of the initial view, which we’ll call the "Enabled Records" view. Then, click on the Copy Form Data button.

Copy Form Data

Upon clicking the Copy Form Data button, around 300 lines of neatly formatted JavaScript code will methodically iterate over each editable control and its state, copying the content to the clipboard.

Next, you can proceed to edit the other object. For this example, let’s say you are creating a new view.

While editing the form of this new view, click on the Paste Form Data button located at the top right corner of the form.

Paste Form Data

This action will open the following window:

Paste Window

You should then paste the copied code. You can achieve this by using the Ctrl+V combination or by right-clicking the mouse and selecting the "Paste" option from the displayed menu.

Pasted Code

As a result, the code will be pasted, and those 300 lines of code will effectively locate the corresponding controls and restore their values. This process simulates typing, selecting, clicking, and checking as necessary.

After clicking the OK button, the modified form will be displayed:

Changed New View

You can observe that the form of the newly created view is identical to that of the initial "Enabled Records" view. This feature proves handy when you need to copy/paste object forms from the Development Branch to the production database.

Now you can save the changes.

In reality, you are not restricted to the Production/Dev.Branch pair. You can attempt to copy and paste across various contexts as long as the objects share common properties. Almost all objects have at least name, notes, and help text in common.

Let’s say you decide to visualize the data from a summary view using a chart view. These two types of views have many common attributes. You can simply copy the edit form of the summary view and paste it into a new chart view. The only remaining step is to select the appropriate chart type.

Or you can try copying button settings into a document and vice versa.

You can also copy between a database and its modified copy — we’ll make every effort to facilitate this process.

One important detail to note: as of the time of writing, only the Chrome browser supports the programmatic access to the clipboard required for the paste action. To work around this limitation for non-conformant browsers, we display a dialog with a text box for users to manually paste the clipboard data using keyboard shortcuts or menu options.