Skip to content

[Event Requests] - Codeunit 7000 "Sales Price Calc. Mgt." #29943

@exnihiloo

Description

@exnihiloo

Why do you need this change?

  1. Procedure SalesLinePriceExists
    The integration event OnBeforeSalesLinePriceExists currently lacks sufficient sender/context parameters, even though it is invoked from the procedure SalesLinePriceExists, which itself is called from multiple places within Sales Price Calc. Mgt. and relies on already-initialized global variables.
    This limits the ability for extensions to correctly react depending on the caller and current calculation context.
    SalesLinePriceExists is invoked from multiple entry points
    Global variables (Qty, QtyPerUOM, currency context, etc.) are already initialized at this stage
    Alternatives Evaluated:
    Existing pricing events were reviewed, but:
    No other event fires at the same execution point with access to initialized global state
    Performance Considerations:
    Event is already executed as part of pricing checks
    Adding parameters does not add logic, loops, or database access
    No measurable performance impact expected
    Data Sensitivity Review:
    Only existing session records (Sales Header, Sales Line, temp pricing data) are exposed
    No additional data, no crossΓÇæcompany access
    No security or privacy concerns identified
  2. Procedure SalesLineLineDiscExists
    The integration event OnBeforeSalesLineLineDiscExists currently lacks sufficient sender/context parameters, even though it is invoked from the procedure SalesLineLineDiscExists, which itself is called from multiple places within Sales Price Calc. Mgt. and relies on already-initialized global variables.
    This limits the ability for extensions to correctly react depending on the caller and current calculation context.
    SalesLineLineDiscExistsis invoked from multiple entry points
    Global variables (Qty, QtyPerUOM, currency context, etc.) are already initialized at this stage
    Alternatives Evaluated:
    Existing pricing events were reviewed, but:
    No other event fires at the same execution point with access to initialized global state
    Performance Considerations:
    Event is already executed as part of pricing checks
    Adding parameters does not add logic, loops, or database access
    No measurable performance impact expected
    Data Sensitivity Review:
    Only existing session records (Sales Header, Sales Line, temp pricing data) are exposed
    No additional data, no crossΓÇæcompany access
    No security or privacy concerns identified

Describe the request

  1. Event OnBeforeSalesLinePriceExists
    current:
[IntegrationEvent(false, false)]
    local procedure OnBeforeSalesLinePriceExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesPrice: Record "Sales Price" temporary; Currency: Record Currency; CurrencyFactor: Decimal; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var InHandled: Boolean)
    begin
    end;

modified:

[IntegrationEvent(true, false)] //Include sender on event
    local procedure OnBeforeSalesLinePriceExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesPrice: Record "Sales Price" temporary; Currency: Record Currency; CurrencyFactor: Decimal; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var InHandled: Boolean)
    begin
    end;

alternative (add "Sales Price Calc. Mgt." codeunit to parameter):

[IntegrationEvent(false, false)] 
    local procedure OnBeforeSalesLinePriceExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesPrice: Record "Sales Price" temporary; Currency: Record Currency; CurrencyFactor: Decimal; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var InHandled: Boolean; this: Codeunit "Sales Price Calc. Mgt.")
    begin
    end;
  1. Event OnBeforeSalesLineLineDiscExists
[IntegrationEvent(false, false)]
    local procedure OnBeforeSalesLineLineDiscExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var IsHandled: Boolean)
    begin
    end;

modified:

[IntegrationEvent(true, false)] //Include sender on event
    local procedure OnBeforeSalesLineLineDiscExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var IsHandled: Boolean)
    begin
    end;

alternative (add "Sales Price Calc. Mgt." codeunit to parameter):

[IntegrationEvent(false, false)] 
    local procedure OnBeforeSalesLineLineDiscExists(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header"; var TempSalesLineDisc: Record "Sales Line Discount" temporary; StartingDate: Date; Qty: Decimal; QtyPerUOM: Decimal; ShowAll: Boolean; var IsHandled: Boolean; this: Codeunit "Sales Price Calc. Mgt.")
    begin
    end;

Internal work item: AB#631593

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions