Selecting a record in Dropdown should throw error based on value in the record

痴心易碎 提交于 2019-12-11 12:14:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!