Codeunit 99000854 "Inventory Profile Offsetting": Inventory Profiles not passed via reference
Hello,
I think I found two bugs:
First
In the above named codeunit is a function called PostInvChgReminder. You can find two Publisher in this function:
- OnBeforePostInvChgReminder(TempReminderInvtProfile, InvProfile, PostOnlyMinimum);
- OnAfterPostInvChgReminder(TempReminderInvtProfile, InvProfile, PostOnlyMinimum);
Both publisher passes InvProfile per refence, but the function itself does not receive the parameter InvProfile via reference which is pretty bad because you cannot access the temporary table in the publisher. Here is the function signature:
PostInvChgReminder(var TempReminderInvtProfile: Record "Inventory Profile" temporary; InvProfile: Record "Inventory Profile"; PostOnlyMinimum: Boolean)
Second
There is a publisher called OnMaintainPlanningLineOnBeforeReqLineInsert which accepts the temporary DemandInvtProfile record. The problem is that the parameters isn't passed via reference from the publisher to the subscriber.
OnMaintainPlanningLineOnBeforeReqLineInsert(var RequisitionLine: Record "Requisition Line"; var SupplyInvtProfile: Record "Inventory Profile"; PlanToDate: Date; CurrentForecast: Code[10]; NewPhase: Option " ","Line Created","Routing Created",Exploded,Obsolete; Direction: Option Forward,Backward; DemandInvtProfile: Record "Inventory Profile")
I cannot imagine that this is on purpose. Can you fix this?
Thanks Andreas
...and again why marked as "event-request"? Are all issues marked as event-request when they have something to do with events?
@AndreasGloeckner Fixes of or additions to events are also marked as event-request :-) The label only ensures that it's passed to the correct team.
Exactly, @NKarolak :-)
Hi @AndreasGloeckner .
- Agree
- Not fully clear what you are talking about. OnMaintainPlanningLineOnBeforeReqLineInsert() is called from MaintainPlanningLine() where DemandInvtProfile parameter came without var. So I can pass this record as var to the publisher but not clear why?
Hi @AndreasGloeckner .
- Agree
- Not fully clear what you are talking about. OnMaintainPlanningLineOnBeforeReqLineInsert() is called from MaintainPlanningLine() where DemandInvtProfile parameter came without var. So I can pass this record as var to the publisher but not clear why?
Hi @RomanZanizdra,
yes, missed that point. While 1st seems to be a bug, 2nd would need to be discussed. To be honest, I was trying to solve a problem and came across this publisher and thought I would need it in a way. In the end, I found another way to implement the requirement. So for now, I think it's okay, if only 1st will be solved :)
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.