When creating a TableExtension and/or PageExtension it would be useful to be able to call the local functions of the original object. This would also come close to the concepts of inheritance. You could also address the inherited object with Base.XYZ to call the function. In this case, it would also make sense to access the global variables in this object.
This definitely belongs to: #153, #120, #186
True, there were already points that had similar requirements. But our requirement in this case was rather an approach known from the object-oriented world. This was not primarily a matter of overwriting existing functions, as described in the other topics. It is much more about accessing existing logic of a page or table. Of course, this is a certain danger, because you have to assume that the actual object changes only slightly from month to month. It would be an improvement if, for example, when creating NAV events, the "sender" would always be transferred by default. Then you could easily access the original object and use its public functions.
That's why I linked them. It's a package for me.
I still see a lot of problems with competing code in general. As I see it, we use the syntax "extension everywhere" from c# 8. I haven't checked yet whether this works in the background.
Bottom line, I think it's cool but the current style and wise also in my eyes a little bit dirty. I really would like to see a clear inheritance structure.
Topics that need to be clarified are, in my opinion:
What about competing apps? For example, an app sets the customer's name to invisible and another app to visible?
Which app wins? Can I control this behavior? When I try to add the field manually, nav Crashs?
I'm adding this because I think it's the same topic or it has the same consequences.
We don't foresee allowing access to local variables/procedures. However, something we are considering longer-term is introduction of protected visibility. It will require base app refactoring before it can be used in extensions though.
I would like to express my support to the idea that tableextensions and pageextensions do have access to local variables and functions. I'm not talking about inheritance or any calling code with Base.SomeFunction.
Instead, I'm thinking like this: from the code in a tableextension you can directly access fields on the record, without the need of using Rec.SomeField. From that point of view, a tableextension is getting closer to a table then a variable of type Record. Enabling a tableextension to call all functions, including the local functions, makes it even more closer to the original table.
For example, I have seen scenario's where I need functions like CalcBaseQty or CalcUnitCost in a tableextension for table Sales Lines. Which is not possible because those functions are local. But I can call them when I add code to the base table. So why not when writing code in a tableextension?
I totally agree with Arend-Jan. Have a look at Sales Order Subform and try to validate the field „No.“ and compare the results. There are several (page) local functions which are called (e.g. OnAfterValidateNo or OnAfterValidateQty). I think that code cloning is not the right way - remember that the code could be changed with every CU.
The best solution would be to have full access to the object when implementing a page or table extension. The easiest to declared them like some others as „external“ ;)
Hi,
I have wrote in issue #2421 and Gallimathias (thanks) redirect me to this issue, but I don't find there the solution.
I add a new procedure (personalization) in a tableextension because the original procedure is internal, and I not have acces to global variables defines in the table.
In this example I can declare local variables but not always is the solution. Is posible, using AL, access to global variables?

Facing the same problem. I want to be able to change the "Ship-to" field (ShipToOptions) to "Custom Address" in the Sales Order page. This is a global variable in the page. Is it even possible to change the value in this field from an extension?
If a Publisher in the main page is giving Access to "globalvar" by a new Publisher, can a subscriber subscribe to a global Variable, which is only introduced in the page extensions?
Example:
Resource Availability lines.
The Task is to reduce the capacity by absences, and calculate the net availability with this reduced capacity.
There is a Publisher now which allows GlobalVar Access. But you only can subscribe in a codeunit, and there you cannot add new columns to the page (Absence, Netavailability).
This must be done in the page Extension - but the calculation can only be made with Access to global vars (Else, you cannot now if the amounts should be shown as "From XY to XY (Net Change) or until XY (Balance).
@atoader Can we have any insights on the status / planned solution for this issue? Trying to prepare the AL journey, we have to put lots of PageExtensions (that are mainly extending the editable / visibility property) on hold due the inaccessibility of page Globals. Don't know if there's a valid workaround?

@atoader An update on the status of this issue would be helpful. I have to use the UpdateCust() function from the Job Table in my Table Ext,
@fvet @meilel we appreciate the feedback very much! I don't think this feature will make it in for the Fall release because our backlog is filled with other high priority, high value features. I would like to encourage you to post this to our Ideas forum at https://aka.ms/BusinessCentralideas, or vote up the idea if its already there.
This will help us a lot in prioritizing this feature for a future release.
Let's move the 22 votes from the past 1.5 year of this topic to 'ideas' and 👍
https://experience.dynamics.com/ideas/idea/?ideaid=8aa70fdb-2b67-e911-b047-0003ff688f4c
I am creating a page ext for "Item Tracking Lines" page, but I just found out that none of the temp variable is accessible. Is this feature still on track for Oct 2019 release?
@carlosyuwono I'm following this one too. I just encountered the same issue as you with the same page you cited.
Any status update from Microsoft on this enhancement being ready for Oct 2019 wave 2?
Hi! This will be available in the wave 2 2019 release. Any issue marked with the October milestone will be delivered with this release
i still can not access the global variable totalsalesline of page sales order subform.
Most helpful comment
I would like to express my support to the idea that tableextensions and pageextensions do have access to local variables and functions. I'm not talking about inheritance or any calling code with Base.SomeFunction.
Instead, I'm thinking like this: from the code in a tableextension you can directly access fields on the record, without the need of using Rec.SomeField. From that point of view, a tableextension is getting closer to a table then a variable of type Record. Enabling a tableextension to call all functions, including the local functions, makes it even more closer to the original table.
For example, I have seen scenario's where I need functions like CalcBaseQty or CalcUnitCost in a tableextension for table Sales Lines. Which is not possible because those functions are local. But I can call them when I add code to the base table. So why not when writing code in a tableextension?