[Extensibility Bug] codeunit 6516 "Package Management" subscribes to codeunit 22 "Item Jnl.-Post Line" OnBeforeCheckItemTracking.
Our team is extending the feature: Use tracking by package number in reservation and tracking system. We are happy to see that MS added a big number of events to accommodate this.
We do face an issue when trying to overrule the check on item tracking completely because of how the ishandled pattern is used in relation to codeunit 22 "Item Jnl.-Post Line" , procedure CheckItemTracking().
There is an event called OnBeforeCheckItemTracking(ItemJnlLine, GlobalItemTrackingSetup, IsHandled, TempTrackingSpecification);
This event suggests that you can use Ishandled to indicate that custom code already did the Checking of the ItemTracking settings.
We noticed that codeunit 6516 "Package Management" is also subscribing to this OnBeforeCheckItemTracking event. So this makes it impossible to overrule the package tracking part of the item tracking setup.
We think this can be improved / fixed by removing the subscriber in codeunit 6516 "Package Management" and move that code to the OnAfterCheckItemTracking() event. This will restore the expected behavior.
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.