Info |
---|
This event is for the locking scheme that is implemented for planned documents at the Mobile Device (when users are displaying and possibly scanning documents). |
...
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Order Locking", 'OnLockOrderOnUnlockOrder_OnBeforeLockOrderOnBeforeUnlockOrder', '', true, true)]
local procedure OnLockOrder OnUnlockOrder_OnBeforeLockOrderOnBeforeUnlockOrder(_MobDocumentQueue: Record "MOB Document Queue"; var _RequestValues: Record "MOB NS Request Element"; var _IsHandled: Boolean)
begin
// Implement custom business logic here
end;
Example
...
// [Example 01Example] Your own custom locking implementation: Suspend all order locking for Pick lines Suspend all order unlocking for Pick lines (needs similar OnLockOrder_OnBeforeLockOrder event)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Order Locking", 'OnLockOrderOnUnlockOrder_OnBeforeLockOrderOnBeforeUnlockOrder', '', true, true)]
local procedure My01OnLockOrder MyOnUnlockOrder_OnBeforeLockOrderOnBeforeUnlockOrder(_MobDocumentQueue: Record "MOB Document Queue"; var _RequestValues: Record "MOB NS Request Element"; var _IsHandled: Boolean)
begin
if _RequestValues.GetValue('Type') = 'Pick' then begin
_IsHandled := true;
exit;
end;
end;
Example 2
// [Example 02] Confirmation message when attempting specific lock type
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Order Locking", 'OnLockOrder_OnBeforeLockOrder', '', true, true)]
local procedure My02OnLockOrder_OnBeforeLockOrder(_MobDocumentQueue: Record "MOB Document Queue"; var _RequestValues: Record "MOB NS Request Element"; var _IsHandled: Boolean)
var
MobToolbox: Codeunit "MOB Toolbox";
XmlRequestDoc: XmlDocument;
begin
if _RequestValues.GetValue('Type') = 'Pick' then begin
_MobDocumentQueue.LoadXMLRequestDoc(XmlRequestDoc);
MobToolbox.ErrorIfNotConfirm('This is a confirmation message OnGetPickOrderLines...', XmlRequestDoc);
end;
end;
Version History
Version | Changes |
---|---|
MOB5.21 | Introduced |
...