Why do you need this change?
We would like to propose a new integration event to extend the CheckPrepmtAmounts procedure in the Base Application.
The current implementation enforces validation to ensure that the prepayment amount is not reduced below the amount already invoiced. Our requirement is to enable controlled adjustments to Quantity after a prepayment invoice has been posted, while preserving the integrity of the standard FieldErrors logic.
Although the existing OnBeforeCheckPrepmtAmounts event could be used to bypass the procedure, this approach is not ideal as it skips the standard validation logic and FieldErrors. By introducing a more granular event within the procedure, our extension can adjust behaviour without losing the standard checks and reducing code duplication.
Describe the request
Below is the proposed event to be added at the end of the SalesLine.Table.al object:
[IntegrationEvent(false, false)]
local procedure OnCheckPrepmtAmountsOnBeforeErrorIfPrepmtAmtLessThanInvoiced(var SalesLine: Record "Sales Line"; var xSalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"; var RaiseError: Boolean)
begin
end;
The event should be placed right before the If condition that checks the prepayment amount invoiced and the document status. Please see the code suggestion below:

Why do you need this change?
We would like to propose a new integration event to extend the
CheckPrepmtAmountsprocedure in the Base Application.The current implementation enforces validation to ensure that the prepayment amount is not reduced below the amount already invoiced. Our requirement is to enable controlled adjustments to Quantity after a prepayment invoice has been posted, while preserving the integrity of the standard FieldErrors logic.
Although the existing
OnBeforeCheckPrepmtAmountsevent could be used to bypass the procedure, this approach is not ideal as it skips the standard validation logic and FieldErrors. By introducing a more granular event within the procedure, our extension can adjust behaviour without losing the standard checks and reducing code duplication.Describe the request
Below is the proposed event to be added at the end of the
SalesLine.Table.alobject:The event should be placed right before the
Ifcondition that checks the prepayment amount invoiced and the document status. Please see the code suggestion below: