Page field editable/visibile property in a extension

greatscott001
Member Posts: 32
First I know how to set the editable/visibile property of a field on a page that is NOT what I am asking.
Am I missing something basic about extensions?
It is a common request from our users that based upon some business logic one or more fields on a page need to have their editable/visible property set (true/false). How can I do this as part of an EXTENSION?
In order to set the editable/visible property you must use code to to set a Boolean variable. First rule of extensions is "DO NOT make C/AL code modifications". So if you can't modified the code of the page object, where do you put the business logic that determines the editable/visible status?
Okay, so sounds like a job for an event. BUT the OnOpenPage event passes only the "Rec" variable of the page not the page object or it's global variables. So now what? You have an event but nothing to relate back to the sender of the event.
So I can't do this simple customization as an Extension?
Am I missing something basic about extensions?
It is a common request from our users that based upon some business logic one or more fields on a page need to have their editable/visible property set (true/false). How can I do this as part of an EXTENSION?
In order to set the editable/visible property you must use code to to set a Boolean variable. First rule of extensions is "DO NOT make C/AL code modifications". So if you can't modified the code of the page object, where do you put the business logic that determines the editable/visible status?
Okay, so sounds like a job for an event. BUT the OnOpenPage event passes only the "Rec" variable of the page not the page object or it's global variables. So now what? You have an event but nothing to relate back to the sender of the event.
So I can't do this simple customization as an Extension?
0
Best Answer
-
Extensions are not this advanced yet. You have to wait for a future release.
Yes, there are some ugly workarounds that you could try but if you want my opinion you should not do that.
Extensions as today are only usable in the Dynamics 365 space and not really for NAV 2017.5
Answers
-
I am guessing (haven't tried it) that I could add a field to the "Rec" table and set that value in the OnOpenPage event and use that value as the editable/visible property of the page field but that is not a very elegant solution as it violates database normalization rules.
If I could set the editable/visible property to the return value of a function I could put the logic in the table but I have not been able to make that work. I am not even sure a field value will work.0 -
Extensions are not this advanced yet. You have to wait for a future release.
Yes, there are some ugly workarounds that you could try but if you want my opinion you should not do that.
Extensions as today are only usable in the Dynamics 365 space and not really for NAV 2017.5
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