[Extensibility Request] Add OnAfterDecreaseQty event in Codeunit 99000854 "Inventory Profile Offsetting"
Nobody has claimed this yet.
- 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 at the end of the DecreaseQty procedure in Codeunit 99000854 "Inventory Profile Offsetting".
In our planning scenarios, we need to execute custom logic after the standard quantity decrease process has been fully completed and the resulting supply inventory profile has been updated and modified.
Currently, the available OnBeforeDecreaseQty event allows extensions to influence or override the process before it is executed, but there is no supported extensibility point that exposes the final state of the SupplyInvtProfile once all standard decrease logic has finished.
Expected behavior
The standard DecreaseQty procedure performs several operations, including:
- Validating whether the supply can be decreased.
- Applying quantity adjustments according to planning parameters.
- Updating action messages.
- Recalculating quantities.
- Modifying the SupplyInvtProfile record.
- Returning a Boolean value that indicates whether the supply has been fully consumed.
Existing events such as: OnBeforeDecreaseQty allow customization before the process is executed, but they do not provide access to the final result after all standard processing has finished.
Without this event, the available alternatives are:
- Duplicating or replacing parts of the standard planning logic.
- Executing custom logic before the final state is available.
- 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:
OnAfterDecreaseQty
in the following procedure:
procedure DecreaseQty(
var SupplyInvtProfile: Record "Inventory Profile";
ReduceQty: Decimal;
RespectPlanningParm: Boolean): Boolean
Suggested placement
Immediately after the following standard code:
SupplyInvtProfile.Modify();
and before the final return statement:
exit(SupplyInvtProfile."Untracked Quantity" = 0);
Suggested publisher
[IntegrationEvent(false, false)]
local procedure OnAfterDecreaseQty(
var SupplyInvtProfile: Record "Inventory Profile")
begin
end;
Additional context
Business impact
This event would allow extensions to react to the final result of the quantity decrease process using a supported extensibility pattern, avoiding modifications to standard application code.
It would simplify planning-related customizations, reduce upgrade effort, and improve maintainability for partners and customers implementing advanced planning and replenishment scenarios.
In addition, the event could be beneficial for other Business Central implementations that require post-processing logic once the standard supply quantity decrease process has completed.
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Codeunit 99000854 "Inventory Profile Offsetting" and inspect the DecreaseQty procedure, especially SupplyInvtProfile.Modify() and the final return. Add the requested post-processing integration point there, then verify the AL app builds and that subscribers can access the final SupplyInvtProfile state.
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