# Clone Leave Request Supervisor PM Entity

This section explains how to **clone the Leave Request entity** and customize it for the **Supervisor / Project Manager (PM) role**.\
The Supervisor PM entity is used to **review and approve leave requests**, without allowing modification of requester data or leave items.

***

### Objective

By completing this section, you will learn how to:

* Clone an existing Leave Request entity
* Remove create/edit actions that are not allowed for Supervisor PM
* Configure leave data to be **view‑only**
* Prepare a Supervisor PM approval screen for Process Designer integration

***

### Step 1: Clone Leave Request Entity

1. From **ONEWEB App Designer**, go to\
   **Entities > Clone Entity**
2. Select existing entity:

   ```
   Doc Leave Request
   ```
3. Set **Name of Clone Entity** to:

   ```
   Doc Leave Request Supervisor PM
   ```
4. Click **Clone**
5. When the system shows a success message, click **Open Cloned Entity**
6. In the **Search Entities** popup, click the **Pencil icon** to edit the entity

***

### Step 2: Remove Entity Buttons (Requester Actions)

Go to tab **Leave Request** and delete the following **Entity Buttons**:

* Button **Add**
* Button **Delete**
* Button **Save** with Page Action = `ENTITY_INSERT`
* Button **Cancel** with Page Action = `ENTITY_INSERT`

These actions are not permitted for Supervisor PM, since they must not create or modify leave requests.

***

### Step 3: Configure Requester Field (Read‑Only)

#### Field: **Requester** (Text Box)

1. Go to module **Leave Request**
2. Locate field **Requester**
3. Click **Pencil icon**
4. Set:
   * **viewFlag** = `Y`
5. Click **OK**

This ensures Supervisor PM can view requester information but cannot edit it.

***

### Step 4: Configure Leave Type Field (Read‑Only)

#### Field: **Leave Type** (Dynamic List)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 5: Configure Project Field (Read‑Only)

#### Field: **Project** (Dynamic List)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 6: Configure Contact / Tel Field (Read‑Only)

#### Field: **Contact/Tel.** (Text Area)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 7: Configure One Down / Head Decision Field

#### Field: **One Down / Head** (Dynamic List)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 8: Configure One Down / Head Remark Field

#### Field: **One Down / Head Remark** (Text Box)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 9: Configure HR Decision Field

#### Field: **HR** (Dynamic List)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 10: Configure HR Remark Field

#### Field: **HR Remark** (Text Box)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 11: Configure Authorize Decision Field

#### Field: **Authorize** (Dynamic List)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 12: Configure Authorize Remark Field

#### Field: **Authorize Remark** (Text Box)

1. Click **Pencil icon**
2. Set:
   * **viewFlag** = `Y`
3. Click **OK**

***

### Step 13: Go to Tab Normal Leave

Navigate to tab **Normal Leave**

***

### Step 14: Remove Normal Leave Module Buttons

In module **Normal Leave**, delete the following buttons:

* Button **Cancel** (Page Action = `INSERT`)
* Button **Add**
* Both **Save** buttons
* Button **Delete**

Supervisor PM must not add, edit, or delete leave items.

***

### Step 15: Set Normal Leave Fields to View‑Only

In module **Normal Leave**, edit the following fields and set:

* **Leave Type** → `viewFlag = Y`
* **Specify** → `viewFlag = Y`
* **Start Date** → `viewFlag = Y`
* **End Date** → `viewFlag = Y`

***

### Step 16: Go to Tab Replacement Leave

Navigate to tab **Replacement Leave**

***

### Step 17: Remove Replacement Leave Module Buttons

In module **Replacement Leave**, delete the following buttons:

* Button **Cancel** (Page Action = `INSERT`)
* Button **Add**
* Both **Save** buttons
* Button **Delete**

***

### Step 18: Set Replacement Leave Fields to View‑Only

In module **Replacement Leave**, set the following fields:

* **Work Date** → `viewFlag = Y`
* **RW No** → `viewFlag = Y`
* **Leave Date** → `viewFlag = Y`

***

### Final Result

The completed **Doc Leave Request Supervisor PM** entity will appear as shown below:

<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%252FBxmTrMIkLLD5OyMHIStO%252Fimage.png%3Falt%3Dmedia%26token%3D927dc5ab-7f78-4e90-8e66-0e5074c9462c&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=91cc3067&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### Summary

In this section, you have:

* Cloned the Leave Request entity for Supervisor PM
* Removed requester‑level and edit actions
* Configured all leave information to be view‑only
* Prepared a clean approval‑only screen for Supervisor PM

This entity is now ready to be connected to **Process Designer Human Activities** as the **Supervisor / PM approval step** in the Leave Control workflow.


---

# 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/tutorials-examples/leave-control-app/app-designer/clone-leave-request-supervisor-pm-entity.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.
