AL icon indicating copy to clipboard operation
AL copied to clipboard

Functions not accessible in extenstions v2.

Open NicolaiEsbensen opened this issue 9 years ago • 7 comments

I converted our code to al, but get a lot of issues with methods that "can not be used for extension development". I'm a bit puzzled why the accessibility level does not match that of the standard application. Would make development a lot easier. Is there a specific reason for this behavior? I can to some extend understand limiting the access to the system table objects, but can't really grasp this.

Anyways, browsing the other issues it seems like you accept lists of missing access, so there are the ones i've found so far (Might have overlooked some)

ChangeLogMgt (Codeunit 423) LogModification LogDeletion LogInsertion

MoveNegPurchLines (Report 6698) SetPurchHeader ShowDocument

CopyPurchDoc (Report 492) SetPurchHeader

ReleasePurchDoc (Codeunit 415) PerformManualRelease

PurchPostYesNo (Codeunit 91) Preview

PurchCalcDiscByType (Codeunit 66); ApplyDefaultInvoiceDiscount

Purchase Header (Table 38) CalcInvDiscForHeader GetPurchLines SumPurchLinesTemp

ApprovalsMgmt (Codeunit 1535) CreateApprovalRequests CheckPurchaseApprovalPossible CheckSalesApprovalPossible ApproveRecordApprovalRequest FindWorkflow CanExecuteWorkflow IsPurchaseApprovalsWorkflowEnabled

Purchase Post (Codeunit 90) GetPurchLines SumPurchLinesTemp

Sales Post (Codeunit 80) GetSalesLines SumSalesLinesTemp

SegManagement (Codeunit 5051) CopyFieldsToInteractLogEntry

WorkflowManagement (Codeunit 1501); HandleEvent HandleEventOnKnownWorkflowInstance

WorkflowSetup (Codeunit 1502) InitWorkflow

NicolaiEsbensen avatar Aug 02 '17 14:08 NicolaiEsbensen

Our problem is that the base application itself still uses .net interop and some of the internal only API's. Due to the size of the app we had to use some static analysis, that was on the cautious side.

We will take a look at the list.

esbenk avatar Aug 03 '17 06:08 esbenk

Ok, I just foresee that this will be an issue to many as I can see I already is (in the issues list) for other people porting their solution. It should be pretty straightforward to get all procedures and their accessibility level by scanning the base application code in text format. But yes I don't know what tools you have at hand, I just hope that the long term solution isn't to add functions on-demand :)

NicolaiEsbensen avatar Aug 03 '17 07:08 NicolaiEsbensen

It's not as simple as that. E.g. some codeunits in the base app are exposing methods to work with files, maybe through other codeunits. This can only be discovered through static call tree analysis.

The is all about robustness and security when running in a SaaS environment, which is why we have chosen to be on the safe side.

esbenk avatar Aug 03 '17 08:08 esbenk

Ok, yes that makes it a bit more complex. I'm just concerned that we might not be able to port the code as simple as possible, if we are to face a lot of issues like this. So i hope that your analysis will go from overly cautious to just plain cautious :)

NicolaiEsbensen avatar Aug 03 '17 08:08 NicolaiEsbensen

Incoming request are now validated manually. Only the initial process was done using static analysis.

esbenk avatar Aug 03 '17 08:08 esbenk

Because I just see that in the missing functions of the discount functions is spoken. Yes, we would also gladly address this, and also in the booking process available. Unfortunately, however, this has been defined by the system. It is not possible to make a change because many events are still missing in the entire booking process. For example, codeunit 17 and 366 do not have a single event. Thus one can unfortunately relatively few data during the booking check.

FSharpCSharp avatar Aug 04 '17 06:08 FSharpCSharp

Sales Header (Table 36) : CalcInvDiscForHeader is also not accessible. image

chavansachin20 avatar Apr 02 '18 11:04 chavansachin20