# Link Process Button to Process Designer

This section explains how to **link Process Buttons in App Designer** with the **Leave Request workflow** created in **Process Designer**.

Each role in the Leave Control App (Requester, Supervisor PM, One Down Head, HR, Authorize) requires a **Submit button** that either **starts** or **completes** the process flow.

***

### Pre‑Condition

* A **Leave Request process flow** has already been created in **Process Designer**
* Project name: `Leave Request`
* Process name: `LeaveRequest`

***

### 1. Submit Button to Start Process Flow

#### Entity: **Doc Leave Request Requester**

This Submit button is used by the **Requester** to **start** the Leave Request process.

#### Step 1.1: Open Entity

1. From **App Designer**, search entity

   ```
   Doc Leave Request Requester
   ```
2. Click **Edit**

***

#### Step 1.2: Add Process Button

1. From **Button**, drag **Process Button** to the entity button area
2. Button name **SUBMIT\_VALUE** appears
3. Click the **Pencil icon** to edit

***

#### Step 1.3: Configure Process Tab

Set values as follows:

* **Process Type**: `Process`
* **Project**: `Leave Request`
* **Process**: `LeaveRequest`
* **Process Action**: `Start`
* Click **Load from AD**

Mapping steps:

* Collapse **Replacement Leave**
* Map:
  * `Leave Request.Request Id` → `LeaveRequest.request_id`
  * `Leave Request.Requester` → `LeaveRequest.requester`
  * `Leave Request.Request Type` → `LeaveRequest.request_type`

***

#### Step 1.4: Configure Pre Action Tab

* Select first radio
* Method: `saveEntity()`

***

#### Step 1.5: Configure Other Settings Tab

* **buttonName**: `Submit`
* **Page Action**: `ENTITY_INSERT`

Click **OK**

***

#### Step 1.6–1.7: Create Submit Button for Update Mode

Repeat **Step 1.2 – 1.5**, but change:

* **Page Action** → `ENTITY_UPDATE`

This creates **two Submit buttons**:

* Insert mode
* Update mode

***

#### Step 1.8: Save Entity

Click **Save this Entity**

**Requester Submit Button (Start Flow)**

<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%252F2uimTyl10DTwMwxTYXOG%252Fimage.png%3Falt%3Dmedia%26token%3D242b378f-2f6f-4874-b8e5-d465492340b8&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=e36701eb&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<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%252FrE9JVe7JU9FFT3IPipqn%252Fimage.png%3Falt%3Dmedia%26token%3Dc7926863-d483-4e12-90d9-2405647c0033&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=9ee5d192&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### 2. Submit Button to Complete Flow

#### Entity: **Doc Leave Request Supervisor PM**

This Submit button is used by **Supervisor / PM** to **complete their task** in the workflow.

#### Key Differences from Requester

* **Process Action** = `Complete`
* **Page Action** = `ENTITY_UPDATE`

**Supervisor PM Submit Button**

<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%252Fi3b0YZlYdUAK2cV9cioG%252Fimage.png%3Falt%3Dmedia%26token%3Da587fbe8-fd4a-4def-addb-c40e914e54e9&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=d2997ac0&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### 3. Submit Button to Complete Flow

#### Entity: **Doc Leave Request One Down Head**

Steps are the **same as Supervisor PM**:

* Process Type: `Process`
* Project: `Leave Request`
* Process: `LeaveRequest`
* Process Action: `Complete`
* Pre Action: `saveEntity()`
* Page Action: `ENTITY_UPDATE`

**One Down Head Submit Button**

<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%252FS03WlvToeCoBepsJVNBo%252Fimage.png%3Falt%3Dmedia%26token%3Da6186d06-5b7e-44f5-8955-f44b37d1debb&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=8e630d3d&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### 4. Submit Button to Complete Flow

#### Entity: **Doc Leave Request HR**

Configuration is the **same as Supervisor PM and One Down Head**:

* Process Action: `Complete`
* Page Action: `ENTITY_UPDATE`
* Data Mapping: Request Id, Requester, Request Type

**HR Submit Button**

<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%252Fs3LlfCuIfpMxiH0DGDxE%252Fimage.png%3Falt%3Dmedia%26token%3De67b6e69-bf24-4ab7-bdfd-7a2d43eab3f5&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=a0b2299a&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### 5. Submit Button to Complete Flow

#### Entity: **Doc Leave Request Authorize**

This Submit button is used by the **Authorize role** to complete the **final approval**.

Configuration:

* Process Action: `Complete`
* Page Action: `ENTITY_UPDATE`
* Pre Action: `saveEntity()`

**Authorize Submit Button**

<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%252F1Z7F0OV1ug6qfV6fWZQj%252Fimage.png%3Falt%3Dmedia%26token%3D28d07b44-696e-4e42-a051-dffdaad3e49e&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=b6dc0306&#x26;sv=2" alt=""><figcaption></figcaption></figure>

***

### Summary

In this section, you have:

* Linked **App Designer Process Buttons** to **Process Designer workflows**
* Configured **Start** action for Requester
* Configured **Complete** action for all approval roles
* Mapped screen data to Process Business Objects
* Ensured entity data is saved before process execution

This completes the **integration between App Designer and Process Designer** for the **Leave Control App**, enabling a full **end‑to‑end leave approval 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/link-process-button-to-process-designer.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.
