Dynamically showing fields in RTC

Ian_Piddington10199
Member Posts: 167
Hi All
I was trying to dynamically show some fields on a page in the RTC.
In a form I'd have done something like
If ShowFields = True then Begin
CurrForm.Field.VISIBLE(True);
CurrForm.Update;
End;
In the Pages I can see that I can write code like this
If ShowFields = True then Begin
CurrPage.Field.VISIBLE(True);
CurrPage.Update;
End;
So far so good.
When I run the Page in RTC I get a message saying
The VISIBLE() method is obsolete
So I have 2 questions.
1) Anyone know how to dynamically control fields on the Page
2) If its obsolete why is there even code for CurrPage.Field.VISIBLE. What’s it to be used for?
Cheers
Ian
I was trying to dynamically show some fields on a page in the RTC.
In a form I'd have done something like
If ShowFields = True then Begin
CurrForm.Field.VISIBLE(True);
CurrForm.Update;
End;
In the Pages I can see that I can write code like this
If ShowFields = True then Begin
CurrPage.Field.VISIBLE(True);
CurrPage.Update;
End;
So far so good.
When I run the Page in RTC I get a message saying
The VISIBLE() method is obsolete
So I have 2 questions.
1) Anyone know how to dynamically control fields on the Page
2) If its obsolete why is there even code for CurrPage.Field.VISIBLE. What’s it to be used for?
Cheers
Ian
Regards
Ian
Ian
0
Answers
-
1) In Pages, certain control properties can be dynamically changed via expressions. Visible is one of them, as well as Enabled and Editable.
These properties typically show <TRUE> or <FALSE> values in the Page Designer but can also contain an expression, similar to SourceExpr, with the rule that the expression should return a boolean value.
If you have access to Page 21 (Customer Card) you can see the usage of this pattern on the Contact control. Its Editable property has 'ContactEditable'. ContactEditable is a global variable of type boolean. Note that one has to set the 'IncludeInDataset' property on the ContactEditable variable so its value is passed to the Client to support dynamic evaluation.
2) CurrPage.Field.VISIBLE support will be removed from C/AL in SP1.“This posting is provided "AS IS" with no warranties, and confers no rights.”0 -
2)...whoa!good to know! anyway, the property is now really more useful (and "comfortable") with expressions support.
it will be easy to substitute the code (hope to get compiling error, not runtime error [-o< )0 -
Thanks for that. it had me fairly confused for a while.
IanRegards
Ian0
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