Function as Visible/Editable/Enabled property of a Page Control

Dirk_Bourgeois
Member Posts: 6
Does anyone know of a valid reason why I seem to be unable to use a Function as a Visible/Editable/Enabled Property Value ?
The value is a "TRUE/FALSE" string, expects a Boolean.. An [InDataSet] global Boolean isn't a problem, but a function isn't allowed ?
While the CaptionClass property has no issue with using a Function as Property Value.
group(StandardBanner)
{
Visible = (GetControlProperty(Properties::Visible, Identifiers::Step, Step::Two));
// Some Fields Here ....
}
local procedure GetControlProperty(Property: Integer; Identifier: Integer; Context: Integer): Boolean
begin
case (Property) of
Properties::Visible: begin
exit(Step = Context);
end;
Properties::Editable: begin
exit(Step = Context);
end;
Properties::Enabled: begin
exit(Step = Context);
end;
end;
end;
AL is perfectly Valid, same for C/AL..
However, when running the Page it throws:

I would prefer not having to resort to creating a 1000 IncludeInDataset global Booleans for the Wizard Steps..
Using a function to control the Visible/Editable/Enabled property would be ideal.
Anyone have an idea whether I'm doing something wrong, or why this doesn't work ?
The value is a "TRUE/FALSE" string, expects a Boolean.. An [InDataSet] global Boolean isn't a problem, but a function isn't allowed ?
While the CaptionClass property has no issue with using a Function as Property Value.
group(StandardBanner)
{
Visible = (GetControlProperty(Properties::Visible, Identifiers::Step, Step::Two));
// Some Fields Here ....
}
local procedure GetControlProperty(Property: Integer; Identifier: Integer; Context: Integer): Boolean
begin
case (Property) of
Properties::Visible: begin
exit(Step = Context);
end;
Properties::Editable: begin
exit(Step = Context);
end;
Properties::Enabled: begin
exit(Step = Context);
end;
end;
end;
AL is perfectly Valid, same for C/AL..
However, when running the Page it throws:

I would prefer not having to resort to creating a 1000 IncludeInDataset global Booleans for the Wizard Steps..
Using a function to control the Visible/Editable/Enabled property would be ideal.
Anyone have an idea whether I'm doing something wrong, or why this doesn't work ?
0
Best Answer
-
Ofc, the CaptionClass is not reloaded during draws on the Client-Side.. it's only invoked at Initialization of the Page..
Visible/Editable/Enables properties used at each redraw of the Page, so indeed are running Client-Side and there-for require a Client-Side Variable.
You are a 100% correct lubost. At render of a Control it cannot access the Function.
Perhaps Microsoft will fix this with Magic towards the future, or have the Compiler throw this setup as Invalid.
Case Closed, thanks for your feedback !0
Answers
-
Code is processed on server side and property is on client side. You should use java add-in.0
-
Code is processed on server side and property is on client side. You should use java add-in.
However, the CaptionClass property does not share this problem ?
That property can use a Function without any issue..
The code for this as-well is Server-Side while the Control is Rendered Client-Side.0 -
Ofc, the CaptionClass is not reloaded during draws on the Client-Side.. it's only invoked at Initialization of the Page..
Visible/Editable/Enables properties used at each redraw of the Page, so indeed are running Client-Side and there-for require a Client-Side Variable.
You are a 100% correct lubost. At render of a Control it cannot access the Function.
Perhaps Microsoft will fix this with Magic towards the future, or have the Compiler throw this setup as Invalid.
Case Closed, thanks for your feedback !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