Required children records

jujogar10
Participant IV

Is there a way to prevent the user to create a parent record without children records, example: I want to prevent the creation of orders without products.

0 10 396
10 REPLIES 10

I think in the Valid_If for orders put COUNT([Related Products][ProductID]) > 0.

Yes you can do that with the โ€œValid Ifโ€. You canโ€™t create that functionality directly with the Related virtual column, but you can create that in another column like ISNOTBLANK([Related Child Records])

thanks for your answer, could you be more specific please. I should create a new column with a validif condition but is it a virtual column? or a column with an app formula? I do not understand the details

You donโ€™t need to create any new column to your table if you donโ€™t wantโ€ฆ you can use one of your existing normal columns. Letโ€™s say you have 10 normal columns and that one Virtual related list column. If you add that ISNOTBLANK([Related Records]) for example in column #10 and into the option โ€œValid Ifโ€, it will do that job.

@Aleksi Iโ€™m trying to use this strategy to validate that a child form ISNOTBLANK() when the parent form is submitted, but I havenโ€™t been successful. Iโ€™m using the following valid if column constraint for the last real column in my table: ISNOTBLANK([Related TRANSFERS_CAGESs]). Am I doing something wrong? Thanks for your help

Is the result the same if you use COUNT([Related TRANSFERS_CAGESs])?

Jonathan_S
Participant V

Why Not just Make the Children โ€œPart ofโ€ The parents and show them in the form and set the column required?"

Orders should always have a minimum of 1 product but thats it.

This will take care of that.

Yes thatโ€™s true nowadays as Jonathan described. The original post is 1.5 year old and at that moment it didnโ€™t work.

Thanks for the recommendation @Jonathan_S. I did have the Children โ€œPart ofโ€ The parents, but Iโ€™m embarrassed to say that I neglected to set the child column to required. This seems to be working as I hoped now. @Aleksi thanks for your assistance as well

Glad to be of help finally

Top Labels in this Space