AL icon indicating copy to clipboard operation
AL copied to clipboard

Standard Tables functions in AL

Open AmolSalvi opened this issue 9 years ago • 4 comments

Hello

Not able to get Local functions defined in standard tables in AL while creating extension. Any idea how to get these functions in extensions?

Regards Amol

AmolSalvi avatar Aug 03 '17 03:08 AmolSalvi

I'm not sure I understand.

The local functions are local to the object the are defined in and can not be called from other objects. This is not new to extensions.

Can you share more details about the problem?

esbenk avatar Aug 03 '17 05:08 esbenk

Here is scenario I am creating extension for Sales Line table and in sales line table we have function called 'GetSalesheader' which is define as local. I used this function in my customized procedure but it is showing error The GetSalesHeader does not exist in current context I try to use Rec. GetSalesHeader also but still same issue

AmolSalvi avatar Aug 03 '17 06:08 AmolSalvi

The local functions (like GetSalesHeader) are local to the defining object. The tableextension is considered a separate object from the base table.

The reason behind this is that the developer of the original object should have the possibility of hiding functions that he/she for some reason don't want exposed. E.g. planning to refactor them later, not ready as a public API, security, ...

In this particular case it would probably make sense to have the GetSalesHeader function available to extensions for the SalesLine table, but for now we don't have support for that. It is either local or public.

esbenk avatar Aug 03 '17 06:08 esbenk

I think we need to have it in extension or else we need to write our own program/function for the same.

AmolSalvi avatar Aug 03 '17 06:08 AmolSalvi