How to update the status column based on button click in a two-table use case?

Sure, here's how you can format y

   I have created a use case with two tables: `requestor` and `approval`. The `requestor` table has a `status` column which is an enum with the values: `new`, `pending`, `approved`, and `rejected`

problem Statement:

   I need to update the `status` of the `requestor` table based on a button click in the `approval` table. Specifically, when the button is clicked and saved, the `status` in the `requestor` table should change to `pending` if approved, or `rejected` if denied.

   I have created the `approval` table and a view that shows the `requestor` details. I also created a button using the behavior tab to approve the request.

Specific Details:

   Here is a simplified version of my schema:

   requestor table:

   - id (primary key)

   - status (enum: 'new', 'pending', 'approved', 'rejected')

 

   approval table:

   - id (primary key)

   - requestor_id (foreign key referencing requestor.id)

   - other_columns...

 

   The button logic needs to handle the following transitions:

   - If the request is approved, change `status` to `pending`.

   - If the request is rejected, change `status` to `rejected`.

 

5. Request for Help:

   Could someone guide me on how to implement the button logic to update the `status` column in the `requestor` table based on the approval or rejection action?

1 2 117
2 REPLIES 2
Top Labels in this Space