microsoft / microsoft/BCApps

[Extensibility Request] Add OnBeforeDecreaseQtyForMaxQty event in Codeunit 99000854 "Inventory Profile Offsetting"

Open Beginner friendly
#9,474 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved event-request Team: SCM
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

We would like to request a new Integration Event in Codeunit 99000854 "Inventory Profile Offsetting" immediately before the standard call to DecreaseQtyForMaxQty in the MatchAttributes procedure.
In our planning scenarios, we need to execute custom logic before the quantity reduction logic for maximum quantity replenishment is applied. Specifically, when the system evaluates supply and demand profiles and the SKU uses the Maximum Qty. reordering policy, standard code executes DecreaseQtyForMaxQty.
Currently, there is no supported extensibility point at this exact point in the flow, preventing extensions from influencing this specific planning behavior without modifying standard application code.

Expected behavior

The standard planning logic evaluates supply and demand matching and, in maximum quantity replenishment scenarios, executes the following logic:

if (TempSKU."Reordering Policy" = TempSKU."Reordering Policy"::"Maximum Qty.")
    and DemandForAdditionalProfile then
    DecreaseQtyForMaxQty(
        SupplyInvtProfile,
        SupplyIleInvtProfile."Untracked Quantity");

Existing extensibility points around the broader matching process are not sufficient for our scenario because the customization must be executed specifically after the order-to-order quantity adjustment logic and immediately before the call to DecreaseQtyForMaxQty.
Without this event, the available alternatives are:

  • Duplicating or replacing parts of the standard planning logic.
  • Introducing fragile workarounds.
  • Modifying standard application code.

These approaches increase maintenance effort, upgrade costs, and implementation complexity.

Steps to reproduce

Suggested solution

Add a new Integration Event named:
OnBeforeDecreaseQtyForMaxQty
in the following procedure:
local procedure MatchAttributes(var SupplyInvtProfile: Record "Inventory Profile"; var DemandInvtProfile: Record "Inventory Profile"; RespectPlanningParm: Boolean; DemandForAdditionalProfile: Boolean)

Suggested placement

Immediately before the following standard code:

if (TempSKU."Reordering Policy" = TempSKU."Reordering Policy"::"Maximum Qty.")
    and DemandForAdditionalProfile then
    DecreaseQtyForMaxQty(
        SupplyInvtProfile,
        SupplyIleInvtProfile."Untracked Quantity");

**Suggested publisher**

[IntegrationEvent(false, false)]
local procedure OnBeforeDecreaseQtyForMaxQty(
    var SupplyInvtProfile: Record "Inventory Profile";
    var DemandInvtProfile: Record "Inventory Profile";
    var RequisitionLine: Record "Requisition Line";
    var TempSKU: Record "Stockkeeping Unit" temporary)
begin
end;
Additional context

Business impact

This event would allow extensions to adapt planning behavior in a supported way for maximum quantity replenishment scenarios.
It would avoid code customization in the standard application and make planning-related extensions easier to maintain and upgrade.
In addition, this extensibility point could benefit other partners and customers that need to influence supply reduction behavior in this specific planning branch while remaining fully upgrade-safe.

@rutxy16eyna @Migvazmar @EYN-Jaime @CAS-EYNA @cso-eyna

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Codeunit 99000854 "Inventory Profile Offsetting" and locate the MatchAttributes procedure and its DecreaseQtyForMaxQty call. Review the surrounding records and existing integration-event conventions, then verify that the new publisher is available at the requested point and preserves the existing maximum-quantity planning behavior.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.