Use this event to
...
Note | ||
---|---|---|
| ||
Database transactions in [...]OnBeforeRunWhsePostShipment is committed to the database prior to calling the standard "Whse.-Post Shipment" function. Your customized code must be structured accordingly. You may subscribe to standard posting events to ensure the rollback of your database transactions or trigger events on-after posting , if this is required for your code. |
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Ship", 'OnPostShipOrder_OnBeforeRunWhsePostShipment', '', truetrue, truetrue)]
local procedure OnPostShipOrder MyOnPostShipOrder_OnBeforeRunWhsePostShipment(var _WhseShipmentLinesToPost: Record "Warehouse Shipment Line"; var _WhsePostShipment: Codeunit "Whse.-Post Shipment")
begin
end;
See also:
How-to: Subscribing to standard events
Example
// [Example]: Print Document on Posting
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Ship", 'OnPostShipOrder_OnBeforeRunWhsePostShipment', '', truetrue, truetrue)]
local procedure MyOnPostShipOrder My01OnPostShipOrder_OnBeforeRunWhsePostShipment(var _WhseShipmentLinesToPost: Record "Warehouse Shipment Line"; var _WhsePostShipment: Codeunit "Whse.-Post Shipment")
begin
_WhsePostShipment.SetPrint(true);
var _WhsePostShipment: Codeunit"Whse.-Post Shipment")
begin
_WhsePostShipment.SetPrint(true);
end;
// [Example]: Invoice Document on Posting
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Ship", 'OnPostShipOrder_OnBeforeRunWhsePostShipment', '', true, true)]
local procedure My02OnPostShipOrder_OnBeforeRunWhsePostShipment(var _WhseShipmentLinesToPost: Record "Warehouse Shipment Line"; var _WhsePostShipment: Codeunit "Whse.-Post Shipment")
begin
_WhsePostShipment.SetPostingSettings(true); // Parameter is "PostInvoice"
end;
Version History
Version | Changes |
---|---|
MOB5.14 | Introduced |
...