Update another table when entri deleted

I have an inventory management application, and there are 2 tables, namely Stock
In Log & Warehouse

In the warehouse table there is a column called Available Stock where I want if an entry in the stock in log is deleted then the value in available stock will also be updated.

For example, I have action data to add automatically when a stock in log form is created:
Triggers
1. SI Trigger
2. For a record of this table : Stock In Log
3. Do this : Data: Execute an action on a set of rows
4. Referenced Table: Warehouse
5. Reference Rows : SELECT(Warehouse[UID],[UID]=[_THISROW].[ItemID])
6. Referenced Action: SI Warehouse

Referenced Action
1. SI Warehouse
2. For a record of this table : Stock In Log
3. Do this : Data: set the value of some columns in this row
4. set these columns : [Available Stock] = LOOKUP(MAXROW("Stock In Log","_RowNumber",[ItemID]=[_THISROW].[UID]),"Stock In Log","SIID","New Available Stocks")

Then I created an automation bot with data change type: Add Only and this worked

but when I want to create a deleted entry and restore the value to the warehouse table, nothing works. I'm really confused about how to ensure that an entry in the stock log when it is deleted will return the QTY value to the warehouse[Available Stock] table.

Please help.

0 2 52
2 REPLIES 2

Use multiple steps where the data is copied before the row is deleted.

Thanks for replying my post, Can you give me an example to do that?

Top Labels in this Space