1

Trigger after hide bug

Hello,

When using a table with a Tab “Water” (as first field) with a « trigger after hide » action which updates table fields, that works fine.

But when you delete the record, then the Ninox app gets stuck! Most probably because the trigger tries to update a table field which doesn’t exists anymore as deleted.

How to get around this?

 

4 replies

null
    • Fred
    • 6 mths ago
    • Reported - view

    😮

    I haven't seen this before. Good job in finding it.

    Maybe move the Trigger after hide to Trigger after update of a particular field or the table?

    • Mabel_Kingsley
    • 6 mths ago
    • Reported - view

    Hello,

     According to me to solve this problem  you need to add a condition to check if the record exists before executing the trigger. This way, the trigger won't attempt to update fields of a deleted record. You can use an if statement to ensure the record is still present before performing any updates.

     Thanks

      • dessein
      • 6 mths ago
      • Reported - view

       

      thanks! How do i check if the record still exists?

      • Leo_Woer
      • 3 mths ago
      • Reported - view

        Hi there - I Don't know if you have got an answer, however, here is how I do it (look away from the Danish words "År" and "Måned" and use your own criteria. In my example I create the record if it doesn't exist, and update with extra income if exist. Hope you can use it.

       

      let Xid := (select 'Income totals' where 'Måned' = Xmd and 'År' = Xyr);
      if Xid = false then
          let Xtotalid := (create 'Income totals');
          Xtotalid.('Måned' := Xmd);
          Xtotalid.('År' := Xyr);
          Xtotalid.('Total incl. kørsel excl. moms' := 'Total incl. kørsel excl. moms' + Xtotal)
      else
          Xid.('Total incl. kørsel excl. moms' := 'Total incl. kørsel excl. moms' + Xtotal)
      end

Content aside

  • 1 Likes
  • 3 mths agoLast active
  • 4Replies
  • 70Views
  • 4 Following