# Form

## Overview

In a Servoy application, forms serve as the primary units of UI space. Each form designates a screen area for interacting with UI components, data, and scripted logic. Double-clicking on this item will open the [Form Editor](/reference/servoy-developer/object-editors/form-editor.md).

Expanding a form will show the items contained in the form, UI, as well as data and logic related:

* [controller](/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/form/controller.md#overview)
* [variables](/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/form/variables.md#overview)
* [elements](/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/form/elements.md#overview) When the case, extra items are visible:
* containers: by right-clicking on this item, the user has the option to [Toggle Form Commands](#toggle-form-commands) and to [Add to working set](#add-to-working-set).
* selectedrecord: this item's [contextual list](https://github.com/Servoy/gitbook/blob/master/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/solution-explorer-contextual-list.md#overview) contains all avaialable dataproviders given by the form's datasource (for example table columns, aggregations, calculations, etc.)
* [relations](/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/form/relations.md#overview)

## Properties Summary

See [Form](/reference/servoycore/object-model/solution/form.md#property-summary) for properties that can be set on a **Form** from Properties View.

## Commands Summary

A summary of commands available on this item via right-click context menu:

| Command                                         | Summary                                                                                                      |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [Open in Form Editor](#open-in-form-editor)     | Opens the [Form Editor](/reference/servoy-developer/object-editors/form-editor.md)                           |
| [Open Form Hierarchy](#open-form-hierarchy)     | Opens the [Form Hierarchy](/reference/servoy-developer/views/form-hierarchy.md)                              |
| [Open in Debug Client](#open-in-debug-client)   | Opens Form in Titanium Client                                                                                |
| [Open in Script Editor](#open-in-script-editor) | Opens the form [Script Editor](/reference/servoy-developer/object-editors/scripting-editor.md)               |
| [Create method](#create-method)                 | Create a new form method                                                                                     |
| [Create new sub form](#create-new-sub-form)     | Opens the [New Form Wizard](/reference/servoy-developer/object-editors/new-form-wizard.md) to create subform |
| [Toggle Form Commands](#toggle-form-commands)   | Opens the [Form Editor](/reference/servoy-developer/object-editors/form-editor.md)                           |
| [Add to working set](#add-to-working-set)       | Adds form to a Working Set                                                                                   |
| [Duplicate form](#duplicate-form)               | Creates a (deep) copy of the form                                                                            |
| [Delete form](#delete-form)                     | Deletes form from workspace                                                                                  |
| [Rename form](#rename-form)                     | Change form name                                                                                             |
| [Run JSUnit tests](#run-jsunit-tests)           | Runs JSUnit tests from the form                                                                              |
| [Search for References](#search-for-references) | Search all references in your active solution                                                                |

## Properties Summary

A summary of properties for this item, which can be configured in the Properties Editor. See [Form Object Model](/reference/servoycore/object-model/solution/form.md) for properties that can be modified in Properties Editor.

## Commands Details

The details for each command available on this item via right-click context menu:

### Open in Form Editor

Opens the [Form Editor](/reference/servoy-developer/object-editors/form-editor.md). A form has two parts, user interface file and scripting file. In Form Editor you can change the design of the form.

### Open Form Hierarchy

Opens the [Form Hierarchy](/reference/servoy-developer/views/form-hierarchy.md). There you see the hierarchy tree (according to parent-child relation).

### Open in Debug Client

Open form in Titanium Client. The client opened from Servoy Developer is a Debug Client (as you can debug through it). If you have an opened Client, you can open the selected form in it (as main form).

### Open in Script Editor

Opens the form [Script Editor](/reference/servoy-developer/object-editors/scripting-editor.md). Each form has a design file and a scripting file (javascript code). Is used to encapsulate code specific to that form, that should not be reused from another form (except through inheritance).

### Create method

Create a new form method (javascript function in form scripting file).

### Create new sub form

Opens the [New Form Wizard](/reference/servoy-developer/object-editors/new-form-wizard.md) to create child form (new form whose parent is the selected form).

### Toggle Form Commands

Opens the [Form Editor](/reference/servoy-developer/object-editors/form-editor.md). A form has two parts, user interface file and scripting file. In Form Editor you can change the design of the form.

### Add to working set

Add the form to a working set (like a logical folder for that form).

### Duplicate form

Creates a (deep) copy of the form. You can choose the new form name.

### Delete form

Deletes the form from workspace.

### Rename form

Can choose a new name for the form.

{% hint style="warning" %}
Warning\
This may break your solution if you use the hard coded name in some code of your solution.
{% endhint %}

### Run JSUnit tests

Runs JSUnit tests from selected form. See [Unit Testing](/reference/servoy-developer/object-editors/scripting-editor/unit-tests.md) for what is unit testing and [JSUnit API](/reference/servoycore/dev-api/jsunit.md) for JSUnit testing API.

### Search for References

Search all references of the form in your active solution.

## Contextual List

Here are the item details that appear in the [contextual list](https://github.com/Servoy/gitbook/blob/master/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/solution-explorer-contextual-list.md#overview) and each command available via right-click:

* form name:
  * [Move Code](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#move-code)
  * [Move Sample](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#move-sample)
  * [Create method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#create-method)
* foundset:
  * [Move Code](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#move-code)
  * [Move Sample](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#move-sample)
  * [Create method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#create-method)

When the case, extra items are visible:

* methods and events:
  * [Move Code](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#move-code)
  * [Open in Script Editor](#open-in-script-editor)
  * [Debug Method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#debug-method)
  * [Search for References](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#search-for-references)
  * [Create method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#create-method)
  * [Overrride method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#overrride-method) - applies in case there are inherited methods on the form
  * [Delete method](/reference/servoy-developer/solution-explorer/solution-explorer-contextual-list.md#delete-method)
  * [Run JSUnit test(s)](#run-jsunit-tests)
  * [Open Form Hierarchy](#open-form-hierarchy)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoy-developer/solution-explorer/all-solutions/active-solution/forms/form.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
