Dynamic Expressions for Control Properties

kirtangor
Member Posts: 65
I am using NAV 2009 SP1 w/ SQL Server.
I want to set a boolean property for a control in my page.
Is it necessary that I have to create a boolean variable, set the IncludeInDataset property of that variable to "Yes", and set property value to this variable?
I have a field in my Rec variable whose value determines the value of the control's property. If Rec.Field = TRUE, then the field should be editable, and vice versa. I tried setting the Editable property to "Rec.Field", yet it is giving me an error that the field could not be found.
I also tried creating a method returning a boolean value, and setting the property's value to that method. I am getting the error mentioned below -
I want to set a boolean property for a control in my page.
Is it necessary that I have to create a boolean variable, set the IncludeInDataset property of that variable to "Yes", and set property value to this variable?
I have a field in my Rec variable whose value determines the value of the control's property. If Rec.Field = TRUE, then the field should be editable, and vice versa. I tried setting the Editable property to "Rec.Field", yet it is giving me an error that the field could not be found.
I also tried creating a method returning a boolean value, and setting the property's value to that method. I am getting the error mentioned below -
Error compiling dynamic control expression: 'ReturnBool()' at index '12'. The error is: Unknown function type.Is there any way to avoid the hassle of creating and tracking boolean variables to set a simple property which could be inferred from a record's field value?
Thanks,
Kirtan.
Kirtan.
0
Answers
-
In 2009 you need the boolean variable - you cannot just type in an expression.Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hmmm. So that's confirmed. Thanks for the reply, Freddy.Thanks,
Kirtan.0 -
So I guess this is the NAV 2009's new way to change the value of the page controls' properties.
Step 1. Create a boolean variable which "IncludeInDataset" property is 'Yes', let's call it "Activate".
Step 2. Access the control's properties, assign the boolean variable "Activate" to the specific property we want to change.
Step 3. Depending on the code we write, or field's value from Rec or other record variable, we can change the value of "Activate", therefore affecting the value of the page control property to which we earlier assigned the "Activate" variable.
That's why there aren't page control properties in the Symbol Menu, this is the new way to change them dynamically.Redcodestudio: Web Development, FLASH & Webdesign (and a little NAV, in the future)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