Skip to content

[Event Request] codeunit 22 "Item Jnl.-Post Line" OnBeforeCalculateCostPerUnit #30267

@RytisLemezis

Description

@RytisLemezis

Why do you need this change?

At 4PS Construct, we need to extend the cost calculation flow in codeunit 22 "Item Jnl.-Post Line" for scenarios where the standard criteria for calculating cost per unit are too restrictive.

The current implementation in local procedure CalcCostPerUnitForPositiveValuedQty contains a hardcoded condition that determines whether the positive valued quantity path is used. Because that condition is embedded directly in the base application logic, extensions cannot influence it without changing the base code.

To support customization in a clean and upgrade-safe way, we need an integration event that exposes the calculated decision before the standard logic continues.

This event would allow extensions to adjust the decision whether cost per unit should be calculated using different conditions without replacing the full procedure logic.

This keeps the standard code intact while enabling upgrade-safe customization for partner solutions that need to broaden or narrow the standard condition.

This was asked in the issue #29648, but it was implemented differently and it is not possible to calculate cost per unit using different conditions.

Describe the request

Dear ALAppExtensions team,

On behalf of 4PS, I would like to request an additional integration event in codeunit 22 "Item Jnl.-Post Line".

Current implementation:

Image

Requested change:

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe issue misses information that prevents it from completion.

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions