Validate a Parent based on Child records that are a part of it

We have an app for tracking training. We have sets of images that need to be taken when filling out the training record. I want to prohibit their ability to save the form until they have made child records of these images. They are constantly changing the names and number of images they need to take so I want to use a parent child ref so that they can control the number needed instead of me having to add tons of columns and remove them. How would I go about making the parent invalid until they have all the needed child records?

0 1 406
1 REPLY 1

Steve
Platinum 4
Platinum 4

You might be able to validate the existence of the child records using the REF_ROWS() virtual columns: they might actually refer to the child rows added in the nested form. For instance:

(COUNT([Related childs][Image] - LIST("")) >= 3)

You could use that test in the Valid If expression of some other user-provided column, or you could wrap the Initial value expression for the key column value with it:

IFS(
  (COUNT([Related childs][Image] - LIST("")) >= 3),
    UNIQUEID()
)

The key column doesnโ€™t get a value until the children are valid; the row canโ€™t be saved until it has a key column value.

Top Labels in this Space