Notifications
Announcements
No record found.
Hello!
I want to disable field in the table, if field YesNo in the same table is No. Any ideas?
Thanks ;)
*This post is locked for comments
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.
it doesn't work. I need some, like TableA.fieldToDisable. << and after dot disable that field. Or smth like this
are you looking to disable only the field?
Yes, only one field in the record where other field NoYes will be no
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
TextBoxA.enabled(false)
TextBoxA.enabled(true)
Please verify if this solves your problem
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.
NITESH RANJAN, DENNIS HUESMANN thanks for your answers, but that problem is not solved :(
Could you post your actual lines of code, please (or at least table and field names). Maybe that would clarify things ;)
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2