Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added example for unplanned move

Description

Excerpt

You want to prompt the user to Confirm a message.

Example 1: Planned function posting

Using this event OnPostReceiveOrder_OnBeforePostAnyOrder

Description

Excerpt

You want to prompt the user to Confirm a message.

Example 1: Planned function posting

Using this event OnPostReceiveOrder_OnBeforePostAnyOrder


[EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Receive", 'OnPostReceiveOrder_OnBeforePostAnyOrder''', true, true)]
    local procedure OnPostReceiveOrder_OnBeforePostAnyOrder(var _OrderValues: Record "MOB Common Element"; var _RecRef: RecordRef);
    var
        MobToolbox: Codeunit "MOB Toolbox";
    begin
        MobToolbox.ErrorIfNotConfirm('You are stopped for some condition... Do you want to continue?', _OrderValues);
    end;


Example 2: LockOrder (Planned function, when an Order is selected)

Using this event OnLockOrder_OnBeforeLockOrder

[EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS ReceiveMOB WMS Order Locking", 'OnPostReceiveOrderOnLockOrder_OnBeforePostAnyOrderOnBeforeLockOrder''', true, true)]
    local procedure OnPostReceiveOrder ShowConfirmBox_OnBeforePostAnyOrder(OnBeforeLockOrder(_MobDocumentQueue: Record "MOB Document Queue"; var _OrderValuesRequestValuesRecord "MOB Common ElementMOB NS Request Element"; var _RecRefIsHandledRecordRefBoolean);
    var
        MobToolbox: Codeunit "MOB Toolbox";
    begin
        MobToolbox
    begin
        if _RequestValues.GetValue('Type''Pick' then
            MobToolbox.ErrorIfNotConfirm(_RequestValues, 'You are stopped for some condition... Do you want to continue?', _OrderValues);
    end;

 

Example

2: LockOrder (Planned function, when an Order is selected)

3: Unplanned Move

Using this event OnLockOrder_OnBeforeLockOrder     OnPostAdhocRegistrationOnUnplannedMove_OnAfterCreateWhseJnlLine

Find other functions here PostAdhocRegistration - Integration Events by Registration Type


[EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOB WMS Order LockingMOB WMS Adhoc Registr.",  'OnLockOrderOnPostAdhocRegistrationOnUnplannedMove_OnBeforeLockOrderOnAfterCreateWhseJnlLine',  '',  truetrue,  truetrue)]
        local procedure ShowConfirmBox OnPostAdhocRegistrationOnUnplannedMove_OnBeforeLockOrderOnAfterCreateWhseJnlLine(var _MobDocumentQueueRequestValues:  Record  "MOB Document QueueMOB NS Request Element";  var  _RequestValuesWhseJnlLine:  Record  "MOB NS Request Element";Warehouse Journal Line")
    var
  _IsHandled: Boolean)
    var
        MobToolbox: Codeunit "MOB Toolbox      MobToolbox: Codeunit "MOB Toolbox";
        begin
        if  _RequestValues.GetValue('Type')   =   'Pick' then
            MobToolbox  MobToolbox.ErrorIfNotConfirm(_RequestValues,  'You are stopped for some condition'You are stopped for some condition...  Do you want to continueDo you want to continue?');
        end; 

Example

3

4: Custom Unplanned

function 

function

Using this event OnPostAdhocRegistrationOnCustomRegistrationType


    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnCustomRegistrationType', '', true, true)]
    localprocedure My01OnPostAdhocRegistrationOnCustomRegistrationType(_RegistrationType: Text; var _RequestValues: Record "MOB NS Request Element"; var _SuccessMessage: Text; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
    var
        MobToolbox: Codeunit "MOB Toolbox";
    begin
        if _RegistrationType <> 'MyNewUnplannedName'then
            exit;

        if _IsHandled then
            exit;

        MobToolbox.ErrorIfNotConfirm(_RequestValues, 'You are stopped for some condition... Do you want to continue?');

        _SuccessMessage := 'My custom success message';
        _RegistrationTypeTracking := 'My custom description for the document queue (column RegistationType)';
        _IsHandled := true;
    end; 

Example

4

5: Custom Unplanned function (legacy XML version)

Using this event OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml


    [EventSubscriber(ObjectType::Codeunit, Codeunit Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml''', true, true)]
    local procedure My02OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml(var     local procedure My02OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml(var _XMLRequestDoc: XmlDocumentvar  XmlDocument; var _XMLResponseDoc: XmlDocument XmlDocument; _RegistrationType: Textvar  Text; var _RegistrationTypeTracking: Text Text[200]; var  var _IsHandled: Boolean Boolean)
    var    var
        MobToolbox: Codeunit  Codeunit "MOB Toolbox";
    begin
        if     begin
        if _RegistrationType <> 'MyUnplanned' then then
            exit            exit;

        if if _IsHandled thenIsHandled then
            exit            exit;

        MobToolbox.ErrorIfNotConfirm('You are stopped for some condition... Do you want to continue?', _XMLRequestDoc);

        MOBToolbox.CreateSimpleResponse(_XMLResponseDoc, '');
        _IsHandled IsHandled := true true;
    end    end;

Using HTML formatting:

(Minimum Mobile App version 1.5.9)

You can use simple html formatting of the text to display in the confirmation dialog.

        HtmlTxtToDispaly :=
          '<html>' +
          '<b><font color="blue">' + 'My Text 1 in Bold and Blue' +
          '</font></b>' + '<br><i>' + 'My Text 2 on new line in Italic' +
          '</i><p>' + 'My Text 3 after paragraph' + '<p><b><font color="red">' +
          'My Text 4 in Bold and Red' + '</font></b>' +
          '<br><i>' + 'My Text 5 on new line in Italic' +
          '</i><p>' + 'My Text 6 after paragraph' +
          '</html>';

How it works behind the scenes 

The key ”ForceWarning:” is prefixed to a regular ERROR() command.

Code Block
languagexml
Error('ForceWarning:%1', MyConfirmMessage);


  1. This way front-end App knows to a display a Confirm dialog

    1. Choosing "Cancel" will return the user to the previous screen
    2. Choosing "Confirm" will automatically repeat the request with a “Force” tag included

  2. The Force tag tells the backend that the Process can now be completed and NOT halted by the ERROR command.

  




Filter by label (Content by label)
showLabelsfalse
max150
showSpacefalse
titleSee also
excludeCurrenttrue
cqllabel = "dialog"

 


Example using HTML formatting: