Skip to content

codeunit 99000854 "Inventory Profile Offsetting" OnBeforeTransferFromPurchaseLine #29470

@Kotaite

Description

@Kotaite

Why do you need this change?

At 4PS Construct, we have specific business scenarios where purchase lines referenced in the inventory planning process may not exist as standard purchase orders. This occurs when we work with blanket purchase orders.

When the planning system processes inventory profiles and attempts to link them to purchase lines, the standard implementation assumes that all purchase references point to regular purchase orders (Document Type = Order). If the referenced purchase line does not exist as a regular order, the system encounters an unhandled error that terminates the planning process without providing meaningful context about which record is missing.

The standard SetPurchase procedure uses a direct Get method that throws a generic error when the record is not found, making it difficult for users and support teams to identify and resolve the issue. Additionally, we need the ability to intercept this logic to handle our blanket order scenarios where the purchase line may need to be retrieved using different document types.

To correctly implement our procurement workflow integration with the planning system, we need two enhancements:

A new OnBeforeTransferFromPurchaseLine integration event that allows us to modify the PurchaseLineExists boolean and potentially retrieve the purchase line from alternative sources (such as blanket orders) before the validation occurs.

Improved error handling that captures the result of the Get operation, checks it explicitly, and provides a clear, detailed error message including the Document Type, Document No., and Line No. when the purchase line cannot be found, enabling faster troubleshooting and resolution.

Describe the request

Dear ALAppExtensions team,
On behalf of 4PS, I would like to request a new integration event OnBeforeTransferFromPurchaseLine in codeunit 99000854 "Inventory Profile Offsetting" local procedure SetPurchase

Current code:

Image

Suggested extensibility:

Image Image

Internal work item: AB#614958

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions