Use this event to
Excerpt |
---|
Code to be executed prior to posting via standard posting routinesroutine for Invt. Picks |
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.
...
Note | ||
---|---|---|
| ||
Database transactions in [...]OnBeforeRunWhseActivityPost is committed to database prior to calling standard "Whse.-Activity-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. |
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnPostPickOrder_OnBeforeRunWhseActivityRegisterOnBeforeRunWhseActivityPost', '', true, true)]
local procedure OnPostPickOrder_OnBeforeRunWhseActivityRegisterOnBeforeRunWhseActivityPost(var _WhseActLinesToPost: Record "Warehouse Activity Line"; var _WhseActRegisterWhseActPost: Codeunit "Whse.-Activity-RegisterPost")
begin
end;
See also:
How-to: Subscribing to standard events
Example
// [Example]: Set Qty. to Handle on lines that should be handled automatically before posting. Print Document on Posting
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnPostPickOrder_OnBeforeRunWhseActivityRegisterOnBeforeRunWhseActivityPost', '', true, true)]
local procedure MyOnPostPickOrder_OnBeforeRunWhseActivityRegisterOnBeforeRunWhseActivityPost(var _WhseActLinesToPost: Record "Warehouse Activity Line"; var _WhseActRegisterWhseActPost: Codeunit "Whse.-Activity-RegisterPost")
begin
_WhseActLinesToPostWhseActPost.SetRange("Bin Code", 'STORAGE ROBOT');
if _WhseActLinesToPost.FindSet(true, false) then
repeat
_WhseActLinesToPost.Validate("Qty. to Handle", _WhseActLinesToPost."Qty. Outstanding");
_WhseActLinesToPost.Modify(true);
until _WhseActLinesToPost.Next() = 0PrintDocument(true);
end;
Version History
Version | Changes |
---|---|
MOB5.13 | Introduced |
...