Why do you need this change?
We need an event inside the trigger OnValidate of the field "Qty. to Ship".
Thanks to this event we will be able to manage the variable Confirmed, assigning it a value according to a custom conditions.
There are no alternative events to manage the boolen variable Confirmed, since there are no events in the trigger where Confirmed is a var parameter.
That's why bypass-style control is necessary in this scenario. Moreover we are supposed to subscribe this event in order to add a check on a custom field (which is a quantity). So we will perfectly integrate the already exixting logic.
Describe the request
In trigger OnValidate of field field(21; "Qty. to Ship"; Decimal) of table 7321 "Warehouse Shipment Line" we need an event:
[IntegrationEvent(false, false)]
local procedure OnValidateQtyToShipOnBeforeCheckConfirm(var Confirmed: Boolean; WarehouseShipmentLine: Record "Warehouse Shipment Line"; CurrentFieldNo: Integer)
begin
end;
Changes between **:
trigger OnValidate()
var
ATOLink: Record "Assemble-to-Order Link";
Confirmed: Boolean;
IsHandled: Boolean;
begin
GetLocation("Location Code");
IsHandled := false;
OnBeforeCompareShipAndPickQty(Rec, IsHandled, CurrFieldNo);
if not IsHandled then
if ("Qty. to Ship" > "Qty. Picked" - "Qty. Shipped") and Location."Require Pick" and not "Assemble to Order" then
FieldError("Qty. to Ship", StrSubstNo(Text002, "Qty. Picked" - "Qty. Shipped"));
IsHandled := false;
OnBeforeCompareQtyToShipAndOutstandingQty(Rec, IsHandled);
if not IsHandled then
if "Qty. to Ship" > "Qty. Outstanding" then
Error(Text000, "Qty. Outstanding");
Confirmed := true;
if (CurrFieldNo = FieldNo("Qty. to Ship")) and
("Shipping Advice" = "Shipping Advice"::Complete) and
("Qty. to Ship" <> "Qty. Outstanding") and
("Qty. to Ship" > 0)
then
Confirmed :=
Confirm(
Text009 +
Text010,
false,
FieldCaption("Shipping Advice"),
"Shipping Advice",
FieldCaption("Qty. to Ship"),
"Qty. Outstanding");
**OnValidateQtyToShipOnBeforeCheckConfirm(Confirmed, Rec, CurrFieldNo);**
if not Confirmed then
Error('');
if CurrFieldNo <> FieldNo("Qty. to Ship (Base)") then begin
"Qty. to Ship" := UOMMgt.RoundAndValidateQty("Qty. to Ship", "Qty. Rounding Precision", FieldCaption("Qty. to Ship"));
"Qty. to Ship (Base)" := MaxQtyToShipBase(CalcBaseQty("Qty. to Ship", FieldCaption("Qty. to Ship"), FieldCaption("Qty. to Ship (Base)")));
ValidateQuantityIsBalanced();
end;
if "Assemble to Order" then
ATOLink.UpdateQtyToAsmFromWhseShptLine(Rec);
OnAfterValidateQtyToShip(Rec, xRec);
end;
Performance considerations
The OnValidate trigger of field "Qty. to Ship" is executed only when the field is modified by the user or through code calling Validate("Qty. to Ship"). This validation is part of the normal warehouse shipment process and is not executed in tight loops or high-frequency system operations.
The proposed event:
OnValidateQtyToShipOnBeforeCheckConfirm(Confirmed, Rec, CurrFieldNo);
adds only a single event invocation and passes existing in-memory variables without introducing any additional database operations.
Therefore, the performance impact is negligible.
Data sensitivity review
The event exposes:
var Confirmed: Boolean
WarehouseShipmentLine: Record "Warehouse Shipment Line"
CurrentFieldNo: Integer
No new or sensitive information is exposed. The Confirmed variable only represents the outcome of a confirmation dialog, and CurrentFieldNo is a technical identifier of the field being validated.
The Warehouse Shipment Line record is already accessible through existing extensibility points in the warehouse shipment process and does not expose any additional data beyond what extensions can already access.
Therefore, this change does not introduce any sensitive data exposure concerns.
Multi-extension interaction
The event allows subscribers to modify the value of Confirmed. Therefore, as with any event exposing a var parameter, multiple extensions could potentially assign different values to Confirmed.
However, the risk is considered acceptable because:
- The event is narrowly scoped and only affects the confirmation step that occurs when the quantity to ship differs from the outstanding quantity.
- Subscribers are expected to modify
Confirmed only when they intentionally need to replace or extend the standard confirmation behavior with additional business rules.
- The event does not bypass the remaining validation logic of the trigger; it only influences whether the confirmation is accepted or rejected.
- Extensions that do not need to alter the confirmation behavior can subscribe without changing
Confirmed.
Currently, there is no alternative event that exposes Confirmed as a var parameter. Without this event, partners are forced to duplicate the standard logic or implement unsupported workarounds to integrate additional quantity checks into the existing confirmation process.
Therefore, the conflict risk is limited and acceptable compared to the lack of an extensibility point for this scenario.
Internal work item: AB#640857
Why do you need this change?
We need an event inside the trigger OnValidate of the field "Qty. to Ship".
Thanks to this event we will be able to manage the variable Confirmed, assigning it a value according to a custom conditions.
There are no alternative events to manage the boolen variable Confirmed, since there are no events in the trigger where Confirmed is a var parameter.
That's why bypass-style control is necessary in this scenario. Moreover we are supposed to subscribe this event in order to add a check on a custom field (which is a quantity). So we will perfectly integrate the already exixting logic.
Describe the request
In trigger OnValidate of field field(21; "Qty. to Ship"; Decimal) of table 7321 "Warehouse Shipment Line" we need an event:
Changes between **:
Performance considerations
The
OnValidatetrigger of field "Qty. to Ship" is executed only when the field is modified by the user or through code callingValidate("Qty. to Ship"). This validation is part of the normal warehouse shipment process and is not executed in tight loops or high-frequency system operations.The proposed event:
adds only a single event invocation and passes existing in-memory variables without introducing any additional database operations.
Therefore, the performance impact is negligible.
Data sensitivity review
The event exposes:
var Confirmed: BooleanWarehouseShipmentLine: Record "Warehouse Shipment Line"CurrentFieldNo: IntegerNo new or sensitive information is exposed. The
Confirmedvariable only represents the outcome of a confirmation dialog, andCurrentFieldNois a technical identifier of the field being validated.The
Warehouse Shipment Linerecord is already accessible through existing extensibility points in the warehouse shipment process and does not expose any additional data beyond what extensions can already access.Therefore, this change does not introduce any sensitive data exposure concerns.
Multi-extension interaction
The event allows subscribers to modify the value of
Confirmed. Therefore, as with any event exposing avarparameter, multiple extensions could potentially assign different values toConfirmed.However, the risk is considered acceptable because:
Confirmedonly when they intentionally need to replace or extend the standard confirmation behavior with additional business rules.Confirmed.Currently, there is no alternative event that exposes
Confirmedas avarparameter. Without this event, partners are forced to duplicate the standard logic or implement unsupported workarounds to integrate additional quantity checks into the existing confirmation process.Therefore, the conflict risk is limited and acceptable compared to the lack of an extensibility point for this scenario.
Internal work item: AB#640857