Dynamically showing fields in RTC

Ian_Piddington10199Ian_Piddington10199 Member Posts: 167
edited 2009-04-06 in NAV Three Tier
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

Answers

  • Kerem_KiziltuncKerem_Kiziltunc Member, Microsoft Employee Posts: 10
    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.”
  • BeliasBelias Member Posts: 2,998
    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< )
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Ian_Piddington10199Ian_Piddington10199 Member Posts: 167
    Thanks for that. it had me fairly confused for a while.

    Ian
    Regards

    Ian
Sign In or Register to comment.