Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Description

Excerpt

The API event parameters does not include all the information you want  

Use case

This In this example we will use a work-around will allow you to read the current mobile request

Step 1: Adding custom header filter

Using OnGetReferenceData_OnAddHeaderConfigurations  a Header Field called MyFilter is added

...

[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddHeaderConfigurations', '', true, true)]
localprocedure GetReferenceData_OnAddHeaderConfigurations(var _HeaderFields: Record "MOB HeaderField Element")
begin
        // Header keys can be found by inspecting the GetReferenceData response that happens with every mobile login
        _HeaderFields.InitConfigurationKey('PickOrderFilters');        
        _HeaderFields.Create_TextField(15, 'MyFilter', 'My filter:');
end;


Step 2: Reading the filter from event 

The event OnGetPickOrders_OnIncludeWarehouseActivityHeader does not includs header-filters.

...


[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrders_OnIncludeWarehouseActivityHeader', '', true, true)]

    localprocedure OnGetPickOrders_OnIncludeWarehouseActivityHeader(_WhseActHeader: Record "Warehouse Activity Header"; var _IncludeInOrderList: Boolean)
    var
        MobDocQueue: Record "MOB Document Queue";
        TempHeaderFilter: Record "MOB NS Request Element" temporary;
        MobSessionData: Codeunit "MOB SessionData";
        MobRequestMgt: Codeunit "MOB NS Request Management";
        XMLRequestDoc: XmlDocument;
    begin
        MobDocQueue.GetByGuid(MobSessionData.GetPostingMessageId(), MobDocQueue);
        MobDocQueue.LoadXMLRequestDoc(XMLRequestDoc);
        MobRequestMgt.SaveHeaderFilters(XmlRequestDoc, TempHeaderFilter);

        error('%1', TempHeaderFilter.GetValue('MyFilter')); // This will display "MyFilter" on mobile device
    end;

See also 

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
reversetrue
excerptTypesimple
cqllabel in ("integrationevent","example") and label = "documentqueue"

...