Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 43 Next »

OnBeforePostSalesReturnOrder is for non-warehouse locations only. Warehouse locations will create warehouse receipts in standard BC and is handled via the OnPostReceiveOrder_OnBeforePostWarehouseReceipt event.

Use this event to

Code to be executed prior to posting via standard posting routines.

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.

Steps added at "line" level via OnGetReceiveOrderLines_OnAddStepsToAnyLine is generally handled via OnHandleRegistrationFor[...]-events.


Commit

Database transactions in [...]OnBeforePostSalesReturnOrder is committed to database prior to calling standard "Sales-Post" 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.

Note: The "Sales-Post"-codeunit includes commits in standard code that is not always correctly suppressed for Sales Return Orders, even if SalesPost.SetSuppressCommit(true); is set. This needs to be taken into account and tested carefully before relying on SalesPost rollback for your custom code for Sales Return Orders.


See also: 
How-to: Subscribe to standard events in BC base app


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnPostReceiveOrder_OnBeforePostSalesReturnOrder''', true, true)]
    procedure OnPostReceiveOrder_OnBeforePostSalesReturnOrder(var _OrderValues: Record "MOB Common Element"; var _SalesReturnHeader: Record "Sales Header")
    begin
    end;



Examples


Version History

VersionChanges
MOB5.11Introduced
  • No labels