# Actions

**Actions** are extension hooks provided by **App Designer** that allow developers to attach **custom logic** to an Entity or Module.\
They enable deeper customization of Smart Forms by integrating:

* **Java classes**
* **JavaScript files**
* **JSP / HTML files** (module‑level only)

Actions are typically used to **override default behavior**, introduce custom processing logic, or customize user interaction beyond standard configuration.

App Designer supports **two types of Actions**:

1. **Entity Action**
2. **Module Action**

***

### 1️. Entity Action

**Entity Actions** apply to the **entire entity** and affect all operations performed on that entity.

#### Purpose of Entity Action

Entity Actions are used to:

* Override default **save**, **update**, or **search** behavior
* Attach backend business logic at entity level
* Integrate custom Java or JavaScript logic
* Control entity lifecycle events

> **Limitation**
>
> * Entity Actions **do not support JSP/HTML files**
> * Only **Java Class** and **JavaScript** are allowed

***

#### Entity Action Interface

Entity Action configuration is accessed through the Entity Action area.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FfNct7UKs5W1PvGIgyQhJ%2F0?alt=media" alt=""><figcaption></figcaption></figure>

Available icons:

* 🛠 **Configure Action** – Open Action Field 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%252FNsvlGBWhu7dhxebdhxI0%252F7%3Falt%3Dmedia\&width=300\&dpr=3\&quality=100\&sign=42bc163c\&sv=2) **Delete Action** – Remove existing action
* ![](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%252FmuvDCyIdykBOj18XeQqR%252F8%3Falt%3Dmedia\&width=300\&dpr=3\&quality=100\&sign=ea33124c\&sv=2) **Edit** – Modify action configuration

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fp8viWT5ECkfLWXGHNGKR%2F4?alt=media" alt=""><figcaption></figcaption></figure>

***

#### Entity Action Configuration Properties

| Property             | Mandatory | Description                                          |
| -------------------- | --------- | ---------------------------------------------------- |
| **Module Action ID** | Yes       | System‑generated identifier (read‑only)              |
| **ENTITY\_ID**       | Yes       | Associated Entity ID (read‑only)                     |
| **Process Name**     | Yes       | Operation to hook into: `Search`, `Insert`, `Update` |
| **Script File**      | No        | JavaScript file to attach                            |
| **Class Action**     | No        | Fully‑qualified Java class name                      |

> You may attach:
>
> * **Java class** to override core entity behavior
> * **JavaScript** for client‑side logic

***

### 2️. Module Action

**Module Actions** apply only to a **specific module** within an entity.\
They are used to customize behavior at **module level**, especially for **1‑Many modules** or complex UI sections.

***

#### Purpose of Module Action

Module Actions are used to:

* Override add, update, save actions for a module
* Attach **custom JSP / HTML UI**
* Add Java logic for module operations
* Inject JavaScript for advanced interaction
* Customize module‑specific workflows

> Module Actions support **Java**, **JavaScript**, and **JSP/HTML**

***

#### Module Action Interface

Module Action configuration is accessed from the respective module.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FeUrxAuI2snpsSdrmwPk8%2F5?alt=media" alt=""><figcaption></figcaption></figure>

Available icons:

* 🛠 **Configure Action** – Open Action Field Configuration
* 🗑 **Delete Action** – Remove Module Action
* ✏ **Edit** – Modify configuration

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FLR2KYB2J4P0SlDSlLbmv%2F9?alt=media" alt=""><figcaption></figcaption></figure>

***

#### Module Action Configuration Properties

| Property                 | Mandatory | Description                                          |
| ------------------------ | --------- | ---------------------------------------------------- |
| **Module Action ID**     | Yes       | System‑generated identifier (read‑only)              |
| **MODULE\_ID**           | Yes       | Associated Module ID (read‑only)                     |
| **Process Name**         | Yes       | Operation to hook into: `Search`, `Insert`, `Update` |
| **JSP / HTML File Path** | No        | JSP or HTML page attached to module                  |
| **Script File**          | No        | JavaScript file                                      |
| **Class Action**         | No        | Fully‑qualified Java class name                      |

***

### Entity Action vs Module Action

| Aspect                       | Entity Action | Module Action |
| ---------------------------- | ------------- | ------------- |
| Scope                        | Entire Entity | Single Module |
| Supports Java                | ✅ Yes         | ✅ Yes         |
| Supports JavaScript          | ✅ Yes         | ✅ Yes         |
| Supports JSP / HTML          | ❌ No          | ✅ Yes         |
| Overrides Entity Save/Update | ✅ Yes         | ❌ No          |
| Overrides Module Behavior    | ❌ No          | ✅ Yes         |

***

### Usage Guidelines

* Use **Entity Actions** for entity‑wide business logic
* Use **Module Actions** for UI or module‑specific customization
* Avoid embedding heavy logic in JavaScript when Java is more appropriate
* Clearly document custom actions for maintainability
* Prefer Action hooks over modifying core platform behavior
* Test custom Actions thoroughly to avoid breaking default flows

***

### Summary

**Actions** provide powerful extension points for customizing Smart Form behavior in ONEWEB.

* **Entity Actions**\
  → Customize entity‑level processing using Java or JavaScript
* **Module Actions**\
  → Customize module behavior and UI using Java, JavaScript, or JSP

Together, Actions enable developers to build **highly flexible, extensible, and enterprise‑grade Smart Forms** that go beyond standard configuration.


---

# 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/designer-reference/app-designer/entity/create-new-entity/actions.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.
