Validate field

Hi All,

I have a question ı want validate a field with related other fields and ı cannot find a sulution could you please help me about thats ı will try explain below

I have one lookup(x) in a form and ı have a field(y) on same form so if lookup(x) populated field(y) is must mandatory if not populated lookup (x) field(y) is not must mandatory

How can ı make it

Thanks in advance!

Can you tell us a bit more about your requirement? For example, when you do you want to run the validation? Are the fields bound to a data source? And so on…

Thanks for your answer Martin

I want run validate method when insert data on form. by any user.

Thanks in advancee

validateWrite() method is called automatically on the form datasource (where you can place form-specific logic) and on the table (for logic related valid for the table itself, regardless of in which form it’s used).

If you want to validate an individual field before saving, you can override validate() on form datasource fields and validateField() on table.

Thanks Martin I have fixed it