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
Regards
Ian
0
Answers
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.
it will be easy to substitute the code (hope to get compiling error, not runtime error [-o< )
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Ian
Ian