Code to be executed prior to posting via standard posting routines. When migrating code from older MOB versions, this event is the most direct 1:1 comparison to existing in-line customizations.
Template:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnPostReceiveOrder_OnBeforePostAnyOrder', '', true, true)]
procedure OnPostReceiveOrder_OnBeforePostAnyOrder(var _OrderValues: Record "MOB Common Element"; var _RecRef: RecordRef)
begin
end;
Description:
The event is mostly used to validate collected "header" level steps (added from OnGetReceiveOrderLines_OnAddStepsToAnyHeader) and to write collected header level steps values to fields in the database that subsequently can be accessed from standard posting function events.
Like other Receive "Any"-events, this event is executed for all four different receive document sources (Warehouse Receipt, Purchase Order, Transfer Order and Sales Return Order). If you are implementing changes for a specific document source, you likely should use one of the document-source-specific events (see "is executed after", below).
Steps added at "line" level via OnGetReceiveOrderLines_OnAfterAddStepsAnyLine (Q4 2019) is generally handled via OnHandleRegistrationFor[...]-events.
Commit
Database transactions in [...]OnBeforePostAnyOrder is committed to database prior to calling standard posting function.s 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.
Note: Standard posting functions includes several unconditional commits in standard code. If you need to rely on standard code rollback for your custom code, this needs to be taken into account and the standard integration event you are subscribing to needs to be selected carefully.
Event is executed after each of these following events:
OnPostReceiveOrder_OnBeforePostWarehouseReceipt
OnPostReceiveOrder_OnBeforePostPurchaseOrder
OnPostReceiveOrder_OnBeforePostTransferOrder
OnPostReceiveOrder_OnBeforePostSalesReturnOrder
See also: OnGetReceiveOrderLines_OnAddStepsToAnyHeader
OnPostReceiveOrder_OnHandleRegistrationForAnyLine
How-to: Subscribe to standard events in BC base app
Example:
See:
Case: Add a signature Step on headers for inbound goods documents
Version History:
Version | Changes |
---|---|
MOB5.11 | Introduced |