Hi,
When i delete a row from a table, the defined actions on that row donโt work anymore because the values from the deleted row are no longer available. Is there a workaround for this issue?
Thank you!
Can you make it so the other actions run first and deleting the row is the last action to run?
Those grouped actions are triggered by the delete user action.
Disable the system-provided Delete action and create your own that does things in the order you want.
I have a similar situation. I have a form view for a child table. When the user deletes a row from this child table (which populates the parent table when adding or updating), I want to be able to re-populate the parent table with the most recent record left on the child table.
Youโre suggesting that we can โoverrideโ the delete action. When trying this, I can definitely lookup for the penultimate record (giving that the ultimate should be deleted at the end of the action). What I canโt find is a way to add a subsequent action that deletes that last record.
Iโd honestly appreciate your comments.
From your description, Iโm not sure your situation is similar, but Iโm not sure I understand your situation.
Parent tables typically arenโt populated from child tables. Can you provide more details?
Iโm sorry, Iโm sure I used the wrong terminology.
I have a โunitsโ field from a โLotโ table. I also have a โProduction Lossโ table which every time I add a row, it modifies the โunitsโ from the โLotโ table. So, that โunitsโ value is modified by the last โunits lostโ corresponding record on the โProduction lossโ table.
When I delete a record on โProduction Lossโ I want it not just to be deleted but also to run an action that brings the corresponding โunitsโ value from the โLotโ table back to what it should. In this case, lets assume that thereโs a previous โProduction Lossโ record that should be used again.
I definitely can โoverrideโ the delete action by looking up for that previous record and use it to modify the corresponding "unitsโ value. But - after doing that - Iโll need another action to actually delete the โProduction Lossโ record Iโm intending to.
Iโm hoping I made myself clear. Thank you in advance.
@Steve, @praveen I found a workaround,
Instead of โsendingโ the values from the edited โProduction lossโ modified table, I just created an action that recalcutes the corresponding โLotโ record based on the premises I have, so it โsearchesโ for the most updated information instead of โreceivingโ it. I also created a behavior that triggers this action everytime I add, update or delete a โProduction lossโ record.
Problem solved.
Thank you for your feedback
I think your โworkaroundโ is the better solution.
You can definitely access the values of the row (just by using the column names โ [Price], [Quantity], etc).
You can also explicity use [_THISROW_BEFORE].[Price] to access the version of the row before it was deleted. Though you donโt need to because this is the same as just using the column name.
However, it sounds like you want to use a pre-defined action on the row and thatโs what isnโt being recognized? I tried this on a simple personal app and it appears to both succeed at edit time and at run time.
User | Count |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |