Preventing saving and Sync if related reference view is empty


Hello,
How to prevent saving and Sync the current view when the related reference view is empty -
I want to make it Required to fill in any data in it and not be empty to apply Save and Sync

Solved Solved
0 4 645
1 ACCEPTED SOLUTION

@Tarek_Abualela
You can set this expression to the Valid_if property of the field:

COUNT([Related Press to Enter Stocks]) > 0

And record a specific error message with Error_Message_If_Invalid property

"You should create a stock!"

View solution in original post

4 REPLIES 4

@Tarek_Abualela
You can set this expression to the Valid_if property of the field:

COUNT([Related Press to Enter Stocks]) > 0

And record a specific error message with Error_Message_If_Invalid property

"You should create a stock!"

Thank You so much

Youโ€™re welcome @Tarek_Abualela, my pleasure.

Hey @LeventK , could you elaborate further on this?

I recall using a valid_if on a related table in the past, to ensure that users added at least one related recordโ€ฆ But in my most recent application, it is not working.

Specifically, I am trying to use COUNT([Related Inspections])>0 on the [Related Inspections] virtual column, which shows up in the form to facilitate the adding of related inspectionsโ€ฆ

The problem is, the valid_if formulas donโ€™t seem to evaluate unless there is at least 1 record. Therefore, the COUNT([Related Inspections])>0 is not enforceable.

As a check, I have used COUNT([Related Inspections])=1, for which the valid_if does evaluate and will not allow more than 1 record, but will still allow 0 records.

Finally, it appears the COUNT([Related Inspections])>0 valid_if can be applied to a separate column and it works in that case. But then the error message does not appear below the appropriate column, which is mildly annoying.

Thoughts?

Top Labels in this Space