Can I delete OR disallow SAVE on "empty" parent records?

I am collecting forest survey data and would like to avoid empty parent records.

Can I:

a) disallow saving a parent record (on the form view) or
b) automatically delete a parent record (from the parent table)

โ€ฆ if no child record has been created on the parent form view?

Thank you!

0 5 140
  • UX
5 REPLIES 5

Maybe try to set some columnโ€™s Valid_If as something like this:

COUNT( [Related Children] ) > 0

Thank you Marc. I supposed you mean that I create a column in the parent table that will set the row to false if the COUNT is equal to โ€œ0โ€. And then connect with with an action that will delete this record. I will try that.

If I canโ€™t get this tow work I will try setting up an action that will fire on FORM SAVED and will check for children and delete the row in the parent table if that COUNT is zero.

I will post my solution.

Thank you for your quick response.

No, that is not what I meant. You just put that expression into the Valid_IF setting for some column in the parent, probably any column will work.

Thank you Marc. I now understood and added this into the Valid_IF setting for one of the columns in the parent table. I tested the expression in the expression assistant and it showed FALSE. But the record was still saved in the parent table.

I think I identified why your solution is not working for me.

I am creating the parent record with a grouped action that first creates the record and then opens the form.

I suppose I will try to create an event that somehow executes a delete row action afterwards. Not sure how yet but I will investigate.

Thank you.

Top Labels in this Space