问题
HI I have a dropdown for a field in a form which shows records with each record having values (Name, Status).
Ex:: A1 Active
A2 Active
A3 Inactive
A4 Active
A5 Inactive
If i select A3 or A5 which are inactive i should get a warning/error saying you are selecting inactive value.
How can i acheive this? What is best way to acheive this? Thanks in advance.
回答1:
What about using validation?
Using validateField
or validateWrite
on the table or datasource you can test whether the chosen value is valid.
Also the validate
method on the datasource or control could be used.
Search the Tables or Forms node of the AOT for thousands of examples.
回答2:
On the FormDataSource
override the active method. Reference to current record is by datasource name.
来源:https://stackoverflow.com/questions/27600522/selecting-a-record-in-dropdown-should-throw-error-based-on-value-in-the-record