ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Enhancement] Codeunit 5005351 Change Parameter in function GetSamePhysInvtOrderLine

Open ThomasBrendel opened this issue 8 years ago • 5 comments

Codeunit 5005351 OnRun()

For using own fields in function GetSamePhysInvtOrderLine we need to change the parameter.

Instead of calling with explicit fields of record PhysInvtRecordingLine, we need the whole record.

image

PhsyInvtOrderHeader.GetSamePhysInvtOrderLine(PhysInvtRecordingLine, ErrorText, PhysInvtOrderLine)

ThomasBrendel avatar Aug 20 '18 11:08 ThomasBrendel

Hi there. You can't pass the entire record because the existing parameters are fields coming in different scenarios from different records (e.g. Phys. Invt. Order Line in Codeunit 5886 vs. Phys. Invt. Record Line in Codeunit 5876). There are also scenarios where these parameters are passed from two different records, not just one (e.g. Report 5880).

Could you please provide a bit more detail about why you need the entire record? Is it for filtering on more fields? In case it is, would raising an event to which you could subscribe and perform the filtering be enough? (and not resetting the record in GetSamePhysInvOrderLine method anymore)

AdinaNegrau avatar Dec 06 '18 13:12 AdinaNegrau

Mostly it is for filtering this additional parameter in that functions. Another much better solution would be to add a Directory of type [text, text], that would give us an empty container to inject the additional parameter and we can use it in that described function with a new publisher to set our needed filter in a subscriber on that.

This solution i have written in another issue for "all external functions" as a solution for additional parameter with an example too. This example could be an easy solution for all parameterproblems we have with standardfunctions.

ThomasBrendel avatar Dec 07 '18 08:12 ThomasBrendel

Please have a look at issue #467

ThomasBrendel avatar Dec 07 '18 08:12 ThomasBrendel

Thank you for your suggestion and sorry about the late reply - I had to get on top of the dictionary idea! Actually, the idea is something we have in our backlog for future work, supported by our platform rather than through manual modifications of the parameter list. The effort is slightly bigger and it will be a while before you see it in the product, but as we have it in our backlog, we'd prefer not to start implementing competing solutions. Another issue with your suggestion is, that we don't have dictionaries in C/AL, only in AL - and as you know we haven't completed the move quite yet ;-) An argument table could be used, but again - that's not the solution we're looking for longer term.

Could we provide you with the suggested event quick fix for now? Would that work until the other solution makes it into the product?

JesperSchulz avatar Jan 15 '19 15:01 JesperSchulz

This functionality of part of W1 and therefore I'm closing this request. If something needed, please submit new ask for W1.

AlexanderYakunin avatar Feb 05 '20 07:02 AlexanderYakunin