# One‑to‑One (1-1) Module

The **One‑to‑One (1–1) Module** is used to display and manage **a single record** in the database.\
It is primarily designed for **form‑based data entry and editing**, where each Entity instance corresponds to exactly one database record.

The 1–1 Module uses a **row and column layout**, allowing users to design Smart Forms flexibly according to UI and business requirements.

***

### Purpose of 1–1 Module

The One‑to‑One (1–1) Module is suitable for:

* Capturing or editing **one record at a time**
* Representing **main or header data** of an Entity
* Designing input‑driven Smart Forms
* Managing master data with structured layouts

#### Typical Use Cases

* Customer profile
* Order header
* Employee information
* Master data maintenance screens

***

### Layout Characteristics

Key layout characteristics of a 1–1 Module include:

* **Row and Column based layout**
* Supports **1, 2, or 3 column layouts**
* Fields are placed using **drag and drop**
* Optimized for **form‑style interaction**, not tabular data

To create a 1–1 Module, simply **drag the 1–1 Module icon** into the desired Tab and start designing the layout.

***

### 1–1 Module Configuration Overview

The 1–1 Module provides a configuration panel that contains several property groups (1–5), as shown below:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FxLDpRlt5B5FisOxJGEXM%2Fimage.png?alt=media&#x26;token=1ee1ced0-3e30-4f06-a853-18e7e5673cb4" alt=""><figcaption></figcaption></figure>

***

### Open Module Configuration

![](https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FTe7E7zVJ8RwXZxZJiQfx%252Fimage.png%3Falt%3Dmedia%26token%3D68702403-8a26-4da3-917f-79726452c61d\&width=300\&dpr=3\&quality=100\&sign=ef3984c3\&sv=2) - This icon opens the **Module Configuration** window, where database mapping, key generation, and module behavior are defined.

***

### One‑to‑One Module Configuration Properties

| Module Item    | Mandatory | Description                               |
| -------------- | --------- | ----------------------------------------- |
| Module ID      | Yes       | System‑generated unique identifier        |
| Module Name    | Yes       | User‑defined name for the module          |
| Table Name     | Yes       | Database table mapped to this module      |
| Template Code  | Yes       | UI template (inherits from Entity)        |
| Theme Code     | Yes       | UI theme (inherits from Entity)           |
| Module Key     | Yes       | Primary key field of the table            |
| Prefix         | No        | Prefix added to auto‑generated keys       |
| Postfix        | No        | Suffix added to auto‑generated keys       |
| KeyLen         | Yes       | Length of the primary key                 |
| Sequence       | Yes       | Database sequence used for key generation |
| SQL Select Row | No        | Custom SQL to retrieve a single record    |
| SQL Work Queue | No        | Custom SQL for search page integration    |
| View Mode Flag | No        | Opens module in read‑only mode            |
| Paging Flag    | No        | Enables paging when used in search        |
| Ordering Flag  | No        | Enables sorting when applicable           |

> **Note**\
> Properties such as `SQL Select Row` are specific to **1–1 Modules** and are used to retrieve a **single record**.

***

### Layout and Design Tools for 1–1 Module

#### Drag Module into Layout

![](https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FMlJLrW0a6qnyTJcmi1CU%252Fimage.png%3Falt%3Dmedia%26token%3D00107281-09cf-4280-86be-717b18ebdf6e\&width=300\&dpr=3\&quality=100\&sign=56a4f881\&sv=2) - Used to place the module into rows and columns in a **Multi‑Column Tab Form** layout.

***

#### Configure Column Layout

<div align="left"><figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F9mArmIElpE6eT8Et7KQx%2Fimage.png?alt=media&#x26;token=05fa458c-d206-4485-abf9-00defe723a59" alt=""><figcaption></figcaption></figure></div>

Defines how many columns the module uses:

* 1 Column
* 2 Columns
* 3 Columns

Click **Accept** to apply the selected layout.

***

#### Add Rows and Columns

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FbLE0IMLJ2sEEAW2FDQKS%2Fimage.png?alt=media&#x26;token=cbd95653-c27e-4cf3-b0da-4a96d80df502" alt=""><figcaption></figcaption></figure>

* First icon → Add **Column**
* Second icon → Add **Row**

Users can add multiple rows and columns to design complex form layouts.

<figure><img src="https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FY1GmiKSsvXxne5TTbutK%252Fimage.png%3Falt%3Dmedia%26token%3Dead3ec1c-c17c-4d17-87ba-9e37775edd35&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=9fc1fe41&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

#### Delete Module

![](https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252F5gPOXO4YBwQ4PcWvsYFy%252Fimage.png%3Falt%3Dmedia%26token%3D35d58163-183d-4a2b-9b9b-64dfb247cd4f\&width=300\&dpr=3\&quality=100\&sign=341418fc\&sv=2) - This icon removes the 1–1 Module from the Smart Form layout.\
(Does **not** delete the database table.)

***

### Usage Guidelines

* Use **1–1 Module** for single‑record data only
* Ideal for core or master entity information
* Avoid using for repeating or line‑item data
* Always map to **one database table**
* Use custom SQL only when default behavior is insufficient
* Save frequently while designing layouts

***

### Summary

The **One‑to‑One (1–1) Module** is the primary building block for **form‑based Smart Forms** in ONEWEB.

Key points:

* Manages **single database records**
* Uses **row and column layout**
* Ideal for master or header data
* Highly flexible form design
* Strong integration with database and entity configuration

Using the 1–1 Module correctly ensures Smart Forms are **clean, intuitive, and aligned with business data structures**.


---

# 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.onewebstack.com/oneweb-platform-th/designer-reference/app-designer/entity/create-new-entity/module/one-to-one-1-1-module.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.
