Disable controls on form

sandman
Member Posts: 20
Here's my dilemma, :-k
I have a form with many controls on a tab control and button controls below it. I need to disable one of the button controls when certain fields are set a certain way...
3 controls are related. A check mark control, a text field and a button. The first 2 controls are on the tab control and the button is located below it.
If the check mark control is 'checked' and the value of the text control is at '0' then, the button control is disabled....
If the user unchecks the check box or enters a value in the text box, then button is then enabled...
I'm not sure about the sequence of events on a form, i.e. form refresh, load, etc, so i don't know if thats even possible...
Any help would be appreciated
Thanks,
Using Nav 5.0 SP1
I have a form with many controls on a tab control and button controls below it. I need to disable one of the button controls when certain fields are set a certain way...
3 controls are related. A check mark control, a text field and a button. The first 2 controls are on the tab control and the button is located below it.
If the check mark control is 'checked' and the value of the text control is at '0' then, the button control is disabled....
If the user unchecks the check box or enters a value in the text box, then button is then enabled...
I'm not sure about the sequence of events on a form, i.e. form refresh, load, etc, so i don't know if thats even possible...
Any help would be appreciated
Thanks,
Using Nav 5.0 SP1
0
Answers
-
There is a property, ENABLED, for the controls on a form. It's a boolean and can be set to anything that resolves to a boolean.
Button.ENABLED := ( (Box = TRUE) AND (Value = 0) ).
A better option, though, is to leave the button enabled and check these values in the OnPush trigger. You can then display an error message telling the user what needs to be done. Disabling the button leaves the user on a form with no idea how to make it enabled.0 -
Hmm... Great idea Matttrax! Makes perfect sense.
Thanks for the info0 -
Here's another question and, please forgive it's newbieness.... :P
How do you verify the value of a control, whether its a check box or a text box... I've looked everywhere (which is not a lot considering the huge amount (sarcasm) of reference on C/AL... but couldn't find anything!
Say I have CHECKBOX1 and TEXTBOX1 on FORM1, what would the code look like?
Thanks again0 -
Oh, and i made a mistake on my first post... I need to verify all this when the user clicks on a MenuButton, not a button control.
Can I use the 'OnActivate' trigger instead of the 'OnPush' trigger?0 -
sandman wrote:How do you verify the value of a control
You don't check the value of a control. Each control is bound to a field or variable (SourceExpr property). You check that against a value.sandman wrote:I need to verify all this when the user clicks on a MenuButton, not a button control.
Menu buttons have Menu Data Items which in turn have an OnPush trigger.
You should read through the Application Developer's Guide from the product CD or the Development I courseware. You'll find some very useful information on Form development there. Good luck.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions