Trigger after update record not triggered when linking/adding records to sub-table
I don't know if this is a bug or a feature, but the Trigger after update is only triggered when editing data in normal fields. Any change in a sub-table does not trigger the script. Is there any trick?
Of course, I've added a button that the client can press to manually trigger the scripts, but they can easily forget to clic the button anytime they make changes to sub-tables...
4 replies
-
You can use the trigger After hide of the tab element in your child table. If you don't have a tab element, you can add one in the first position where you can set up the trigger.
-
Hi Javier
The Trigger after update: has to be on the updated table or field. So if you had a Trigger on update: at the table level of the parent
if sum((child).total) = 0 then status := "out of stock" end
but the figures are being updated in the child table, the Trigger after update: actually needs to be at the table level of the child
if sum((parent.child).total) = 0 then parent.status := "out of stock" end
Regards John
-
John Halls Great! Also, your example gave me the clue I needed! So, just by placing an array formula (sum, average, first, last, etc) in a field is enough to trigger the after update in the child table.
It's not intuitive, but makes sense (the parent table is not changing, only the "view" of the child table). I need to think as Ninox thinks, and then everything else begins to make sense.
Thanks again, John Halls
Content aside
- Status Answered
-
1
Likes
- 2 yrs agoLast active
- 4Replies
- 262Views
-
4
Following