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 24 Next »

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). 
Do not confuse with database locks (that is set during processing/posting of the specific documenttypes/registrationtypes).

Use this event to

Implement custom document locking scheme or display messages at Mobile Device.

Description

Using this event you may implement a custom planned document locking scheme. These are the locks that are set for documents at the Mobile Device that will prevent other users from handling same documents at the same time. 

Since this event is consistently called before planned documents are displayed at the mobile device, you may use the event to display confirmation messages at the mobile device when such documents are opened.

See also: OnUnlockOrder_OnBeforeUnlockOrder

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Order Locking", 'OnLockOrder_OnBeforeLockOrder''', true, true)]
    local procedure OnLockOrder_OnBeforeLockOrder(_MobDocumentQueue: Record "MOB Document Queue"; var _RequestValues: Record "MOB NS Request Element"; var _IsHandled: Boolean)
    begin
        // Implement custom business logic here        
    end;

Example 1

    // [Example 01]  Your own custom locking implementation: Suspend all order locking for Pick lines
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Order Locking", 'OnLockOrder_OnBeforeLockOrder''', true, true)]
    local procedure My01OnLockOrder_OnBeforeLockOrder(_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::CodeunitCodeunit::"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

VersionChanges
MOB5.21Introduced
  • No labels