Skip to content

[Event Request] codeunit 442 "Sales-Post Prepayments" - UpdatePrepmtAmountOnSaleslines procedure #30110

Description

@tuan-nguyen-fenwick

Why do you need this change?

We would like to request the addition of 3 new integration events to further enhance the extensibility of the UpdatePrepmtAmountOnSalesLines procedure in Base Application.

The existing implementation does not provide sufficient extension points to control key parts of the prepayment update process. Specifically, we are not able to:

  • Adjust or override the filters applied when retrieving prepayment sales lines.
  • Handle scenarios where no prepayment lines exist without triggering an error.
  • Run custom logic before individual sales lines are updated.

Describe the request

The 2 new proposed events that we would like to add at the end of the SalesPostPrepayments.Codeunit.al object are:

    [IntegrationEvent(false, false)]
    local procedure OnUpdatePrepmtAmountOnSalesLinesOnAfterSetFilters(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"; var NewTotalPrepmtAmount: Decimal)
    begin
    end;

    [IntegrationEvent(false, false)]
    local procedure OnUpdatePrepmtAmountOnSalesLinesOnBeforeModify(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"; var NewTotalPrepmtAmount: Decimal; var TotalPrepmtAmount: Decimal)
    begin
    end;

Event 1: OnUpdatePrepmtAmountOnSalesLinesOnAfterSetFilters should be added after filters are set and right before the table is locked. This allows extensions to adjust filters prior to processing and provides a safe hook before record locking occurs.

Event 2: OnUpdatePrepmtAmountOnSalesLinesOnBeforeModify should be immediately before each line record is modified. This allows extensions to adjust values prior to modification.

Image Internal work item: [AB#640955](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/640955)

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions