ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Codeunit 5802 - "Inventory Posting To G/L" – TempInvtPostBuf – Increase array dimension

Open SSZurmussen7112 opened this issue 5 years ago • 8 comments

In codeunit 5802 we need a bigger array of the global variable TempInvtPostBuf, at least up to 8, perhaps more like 40.

Old: TempInvtPostBuf: array[4] of Record "Invt. Posting Buffer" temporary;

New: TempInvtPostBuf: array[8] of Record "Invt. Posting Buffer" temporary;

Perhaps: TempInvtPostBuf: array[40] of Record "Invt. Posting Buffer" temporary;

We have an app which creates additional postings when inventory postings were done. To do so we use the publisher OnAfterBufferOutputPosting(...) in codeunit 5802, which includes also the sender. To create our own postings we use the function sender.InitInvtPostBuf(...) as often as the Business Central standard does it. It seems that BC standard needs max. 2 times such InitInvtPostBuf(...), because the array of TempInvtPostBuf is set up with 4 dimensions and each call of this function increases the counter PostBufDimNo twice. But we need as many dimensions as BC standard of such variable, so at least 8.

Because I found e.g. this issue 4738 perhaps it would make sense to increase it a bit more (e.g. from 4 to 40) because if other partners will also use this technique parallel to our app, it will appear the same error "Index out of bounds.".

Thanks and best regards, Stephan

SSZurmussen7112 avatar Jan 07 '21 12:01 SSZurmussen7112

This change is important to fix an issue in an app that is already available in AppSource. Can this request be prioritized?

IngoStender avatar Jan 20 '21 07:01 IngoStender

Any news on this issue? It's already 20 days ago I created it and a customer can't post his output because an error appears because such array is to small. Thanks in advance! Stephan

SSZurmussen7112 avatar Jan 27 '21 09:01 SSZurmussen7112

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar Feb 05 '21 08:02 JesperSchulz

Hi Jesper, I have seen that you have increased the mentioned array from 4 to 20 in the current BC18 version! Thanks for that! But in three functions, where such array variable is used as parameter, the array has still the dimension 4. I am not sure if this is needed to increase them up to 20, too, because they are all var parameters. But I think all they should be defined in the same way, don't they?

local procedure OnAfterBufferConsumpPosting(var TempInvtPostingBuffer: array[4] of Record "Invt. Posting Buffer" temporary; ValueEntry: Record "Value Entry"; var PostBufDimNo: Integer; var CostToPost: Decimal; var CostToPostACY: Decimal)

local procedure OnAfterBufferSalesPosting(var TempInvtPostingBuffer: array[4] of Record "Invt. Posting Buffer" temporary; ValueEntry: Record "Value Entry"; var PostBufDimNo: Integer)

local procedure OnAfterInitTempInvtPostBuf(var TempInvtPostBuf: array[4] of Record "Invt. Posting Buffer" temporary; ValueEntry: Record "Value Entry"; PostBufDimNo: Integer)

And I noticed that this change was not released in BC17.5. That's a pity. Will it be released in BC17.6?

Thanks and have a nice day! Stephan

SSZurmussen7112 avatar Mar 12 '21 08:03 SSZurmussen7112

I will forward your questions to the engineers, who addressed your issue. They should get back to you with more details!

JesperSchulz avatar Mar 15 '21 14:03 JesperSchulz

Availability update: We will publish a fix for this issue in the next update for release 17.

JesperSchulz avatar Mar 23 '21 11:03 JesperSchulz

Availability update: We will publish a fix for this issue in the next update for release 18.

JesperSchulz avatar Mar 24 '21 06:03 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar Apr 19 '21 09:04 JesperSchulz