1

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...

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 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.

    Like 1
    • John Halls
    • John_Halls
    • 2 mths ago
    • Reported - view

    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

    Like 1
    • Javier
    • Nousmedis Innovación S.L.
    • Javier
    • 2 mths ago
    • Reported - view

    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

    Like
      • John Halls
      • John_Halls
      • 2 mths ago
      • Reported - view

      Javier You are right in that the parent is not changing, the view. It's not the sum function that's causing the trigger. Triggers only ever happen when you go into a field and make a change to the data.

      Like
Like1 Follow
  • Status Answered
  • 1 Likes
  • 2 mths agoLast active
  • 4Replies
  • 59Views
  • 4 Following