How to get 'Deletes_Only' Bot on child record to work when you delete a parent record, and all child records are deleted

I have three tables.

Table 1: Work Orders (Parent)

Table 2: Work Order Line Items (Child)

Table 3: Inventory

I currently have two bots working using webhooks.
Adds_Only - Whenever a work order line item is created, it adds the qty to the inventory table.
Deletes_Only - If that line item is deleted, it removes the qty from the inventory table.

Here is my JSON text, the Deletes_Only is the same except it subtracts from Qty Produced instead of adding.

{
โ€œActionโ€: โ€œEditโ€,
โ€œPropertiesโ€: {
โ€œLocaleโ€: โ€œen-USโ€,
โ€œTimezoneโ€: โ€œMountain Standard Timeโ€
},

โ€œRowsโ€: [
<<START:SELECT(Parts[Part ID],[Description]=[_THISROW].[Product/Part])>>
{

โ€œPart IDโ€: โ€œ<<[Part ID]>>โ€,
โ€œQty Producedโ€: โ€œ<<[_THISROW].[Qty]+[Qty Produced]>>โ€

}
<>
]
}

If I delete a Work Order, it deletes all child records in the Work Order Line Items Table, but the โ€˜Deletes_Onlyโ€™ bot does not trigger when this happens.

How do I make a bot that triggers off of the Work Orders table that runs for each child record?

Any help would be much appreciated.

Thanks!

1 11 588
11 REPLIES 11
Top Labels in this Space