# Parent Child Utility

The **Parent Child Utility** in ONEWEB is used to **link two entities together** by establishing a relationship between their **main module keys**.\
This utility enables developers to build **complex Smart Form structures** by associating multiple entities into a coherent parent–child relationship.

It is particularly useful when business requirements demand **multiple related entities** working together to capture, display, or maintain business data.

***

### Purpose of Parent Child Utility

The Parent Child Utility is designed to:

* Establish relationships between two entities
* Define **parent–child data navigation**
* Enable seamless redirection from a parent entity to a related child entity
* Support complex smart form workflows
* Improve usability by linking related data screens

This utility bridges **entity‑level design** with **relational business logic**.

***

### Accessing Parent Child Utility

To access the Parent Child Utility:

1. Navigate to **DEV ZONE**
2. Open **App Designer**
3. Click the **Utilities** icon
4. Select **Parent Child Entities**

The steps are illustrated below (Steps 1–4):

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

***

### Parent Child Configuration Overview

Using the Parent Child Utility, users can:

* Select a **Parent Entity**
* Select a **Child Entity**
* Define where and how the relationship is created
* Configure navigation buttons to open the Child Entity from the Parent Entity

The Parent Child Configuration screen is shown below:

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

***

### Creating a Parent–Child Relationship

To create a new Parent Child relationship:

1. Click the **Add** icon ![](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%252FFcBRxQtoKSEEFJOLDDrd%252F3%3Falt%3Dmedia\&width=300\&dpr=3\&quality=100\&sign=232ed6bb\&sv=2) to create a new configuration
2. The **Parent Child Configuration** window opens

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

***

### Parent Child Configuration Properties

The following table describes all available settings in the **Parent Child Entity** configuration window.

| Item                       | Mandatory | Description                                 |
| -------------------------- | --------- | ------------------------------------------- |
| **Parent Entity**          | Yes       | Select the entity that acts as the parent   |
| **Parent Tab**             | Yes       | Tab from which the child entity is linked   |
| **Parent Module**          | Yes       | Module whose key is used for linking        |
| **Child Entity**           | Yes       | Select the related child entity             |
| **Child Tab**              | Yes       | Main tab of the child entity                |
| **Parent’s Fields**\*      | Yes       | Key field passed from parent entity         |
| **Interface Parameters**\* | Yes       | Parameters passed to child entity           |
| **Child’s Fields**\*       | Yes       | Field in child entity that receives the key |
| **Image Button**           | No        | Enables use of an image‑based button        |
| **Display Value**          | Yes       | Button label shown on Parent Entity         |
| **Sequence**               | No        | Order of the button display                 |
| **Style Class**            | No        | CSS customization                           |
| **Source Tag**             | No        | JavaScript customization                    |

***

### Result of Parent Child Configuration

Once configured:

* A **button appears on the Parent Entity**
* Clicking the button redirects the user to the **related Child Entity**
* Parent entity key values are passed automatically
* Child entity loads data relevant to the selected parent record

This significantly improves the user experience when navigating related business data.

***

### Important Design Consideration

> **Important**\
> To successfully establish a Parent–Child relationship:
>
> * Database design must support the relationship
> * Parent table **primary key(s)** must be referenced in the Child table
> * Any additional required keys must be defined correctly

The Parent Child Utility works best when **entity design and database relationships are aligned**.

***

### Usage Guidelines

* Use Parent Child Utility for complex, multi‑entity workflows
* Clearly define ownership (Parent vs Child) before configuration
* Ensure proper database constraints and keys exist
* Use meaningful button labels for clarity
* Avoid excessive nested relationships to keep navigation intuitive
* Test navigation and data integrity thoroughly

***

### Summary

The **Parent Child Utility** enables ONEWEB developers to build **connected, relational Smart Forms**.

Key points:

* Links two entities through their module keys
* Enables parent‑to‑child navigation
* Supports complex business form structures
* Improves usability and data flow
* Requires proper database relationship design

Used correctly, Parent Child Utility is a powerful tool for designing **enterprise‑grade, relational applications** on the ONEWEB platform.


---

# 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/utilities/parent-child-utility.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.
