Use this event to
Code to be executed prior to posting via standard posting routines.
Description
The event can be used to call functions on the standard posting codeunit before run. For Instance, activate printing document on posting or change filtering on lines before posting.
Commit
Database transactions in [...]OnBeforeRunWhsePostShipment is committed to database prior to calling standard "Whse.-Post Shipment" function. Your customized code must be structured accordingly.
You may subscribe to standard posting events to ensure 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', '', true, true)]
procedure OnPostShipOrder_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', '', true, true)]
procedure MyOnPostShipOrder_OnBeforeRunWhsePostShipment(var _WhseShipmentLinesToPost: Record "Warehouse Shipment Line"; var _WhsePostShipment: Codeunit "Whse.-Post Shipment")
begin
_WhsePostShipment.SetPrint(true);
end;
Version History
Version | Changes |
---|---|
MOB5.14 | Introduced |