Hi. I have a non editable form, but I need one of its controls to be editable.
This is my solution:
By default the editable property in the form is set to false.
In the Onbeforeinput trigger of the control I write:
currform.editable := true;
mycontrol:=editable := true;
In the OnAfterValidate, OnInputChange and OnAfterInput triggers I wrtie:
currform.editable := false;
But if I enter the control and then leave it whithout making no change, none of the OnAfterValidate, OnInputChange and OnAfterInputChange triggers are activated and thus my form stills editable because I set its editable property a true in the OnBeforeInput trigger. How can I prevent this?.
Thanks,
0
Comments
Make all the fields, except the one you need Editable=FALSE.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Post back to let me know! Ta.
Microsoft Dynamics NAV Developer
And about using the OnDeactivate trigger, it's not valid because this trigger only fires when you make Control.ACTIVATE = FALSE and I'm interested in a trigger which fires when you leave a control without making any change.
Thanks for your ideas, I really apreciate them.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
-You can create a new Role and add that to users that may edit all controls.
-In the "OnOpenForm"-trigger, you can check if a user belongs to that Role for current company (or all companies), and then make all the fields editable. Something like this (for DB-logons): Don't add your always editable field.
When a new field is added, you just have to add it to this list.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!