# Entity Modes

**Entity Modes** define how a Smart Form behaves in different stages of its lifecycle, such as creating new data, editing existing records, searching information, or deleting data.\
On the ONEWEB platform, Entity Modes allow designers to **configure UI behavior, validation, buttons, and actions differently for each scenario**.

By using Entity Modes effectively, a single Smart Form can adapt its behavior based on **user intent and context**, improving usability and control.

***

#### Supported Entity Modes in ONEWEB

ONEWEB supports **four Entity Modes**:

* **Insert**
* **Update**
* **Search**
* **Delete**

Each mode represents a different way the Smart Form is opened and used.

***

#### Insert Mode

**Insert Mode** is used when creating a **new record**.

Typical characteristics:

* User enters data for the first time
* Data is inserted as a new record in the database
* Default values, mandatory fields, and validations are applied

Insert Mode is commonly used when:

* Opening a Smart Form via a **New** button
* Starting a new business transaction

All configurations related to new data entry are handled using Insert Mode.

***

#### Update Mode

**Update Mode** is used when editing an **existing record**.

Typical characteristics:

* Existing data is loaded from the database
* Users can modify allowed fields
* Update‑specific validation and logic may apply

Update Mode is commonly used when:

* A record is selected from search results
* Users need to correct or update previously saved information

Designers can control which fields are editable or read‑only in this mode.

***

#### Search Mode

**Search Mode** is used to **find records** stored in the database.

Typical characteristics:

* Users specify search criteria
* Search results are displayed based on filters
* No data insertion or modification occurs

Search Mode is commonly used when:

* Users need to locate existing records
* Data needs to be filtered or reviewed

{% hint style="info" %}
**Important:**\
Search Criteria fields and Search Result columns are **not controlled by Entity Modes**.\
They depend entirely on the **SearchCriteria** and **ShowSearch** properties configured at the **Field level**.
{% endhint %}

***

#### Delete Mode

**Delete Mode** is used when removing data from the database.

Typical characteristics:

* Records are deleted
* Delete‑specific validations or confirmations may apply

Delete Mode is commonly used in:

* Administrative or cleanup scenarios
* Controlled data‑removal workflows

Designers can restrict or customize delete behavior using mode‑specific configuration and actions.

***

#### What Can Be Controlled Using Entity Modes

Entity Modes allow designers and developers to control multiple aspects of Smart Form behavior, including:

* **Display / Hide fields or modules** based on the current mode
* **Entity Buttons** shown or hidden per mode
* **Module Buttons** enabled or disabled per mode
* **Custom Actions** triggered differently for each mode

Advanced users can attach **mode‑specific Entity Actions** to implement complex, requirement‑specific logic.

***

#### Design Perspective

As part of **Smart Form best practices**:

* Use **Insert Mode** for clean and guided data entry
* Use **Update Mode** to protect critical fields
* Keep **Search Mode** simple and focused
* Restrict **Delete Mode** carefully to avoid data loss

Designing with Entity Modes ensures Smart Forms remain **flexible, secure, and user‑friendly**.


---

# 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/building-apps/ui-page-designer/ux-ui-components/smart-forms/entity-modes.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.
