Hello!
I want to disable field in the table, if field YesNo in the same table is No. Any ideas?
Thanks ;)
Please Keep one thing in mind this solution will be application on the form only, you cant have in on the table browser
Please verify.
Could you post your actual lines of code, please (or at least table and field names). Maybe that would clarify things ;)
NITESH RANJAN, DENNIS HUESMANN thanks for your answers, but that problem is not solved :(
Try following code:
YourTable_ds.object(fieldNum(YourTable, YourField)).enabled(YourValueToCheck);
This way you do not need the AutoDeclaration flag and all occurences of the field linked to the data source are disabled/enabled depending on your condition.
Go to the design of the form and location the text box related to the field
Set the Auto declaration property of the text box as true
let suppose text box name is TextBoxA
so write following code in Active() method
if(TableA.YesNO == 'No')
TextBoxA.enabled(false)
else
TextBoxA.enabled(true)
Please verify if this solves your problem
Yes, only one field in the record where other field NoYes will be no
are you looking to disable only the field?
it doesn't work. I need some, like TableA.fieldToDisable. << and after dot disable that field. Or smth like this
You can do it on form, by overriding 'Active()' method of the modify datasource table on the form
let suppose datasource table name is TableA
so write following code in Active() method
if(TableA.YesNO == 'No')
TableA.AllowEdit(false)
else
TableA.AllowEdit(true)
Please verify and let me know if it works for you.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148