Versions Compared

Key

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

Use this event to

Excerpt
Populate values in OrderLines-list on Order Lines displayed at the mobile device (derived from any of four associated line tables). Parameters includes a RecRef-instance for the line table.

...

This event is executed after each of these the following events have has been executed already:


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS ReceiveMOB WMS Pick", 'OnGetReceiveOrderLinesOnGetPickOrderLines_OnAfterSetFromAnyLine''', true true, true true)]
    local procedure OnGetReceiveOrderLines OnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef: RecordRefvar _BaseOrderLineElement: Record "MOB Ns BaseDataModel ElementMOB Ns BaseDataModel Element")
    begin
    end;

 

Example 1: Set value for DisplayLine5

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS ReceiveMOB WMS Pick", 'OnGetReceiveOrderLinesOnGetPickOrderLines_OnAfterSetFromAnyLine', '', true true, true true)]
    local procedure OnGetReceiveOrderLines MyOnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB Ns BaseDataModel ElementMOB Ns BaseDataModel Element")
    var
            Item: Item: Record Item Item;
    begin
     with _BaseOrderLineElement do begin        Item.Get(_BaseOrderLineElement.Get_ItemNumber());     // Get the Item record of the current order line by using a helper function on the BaseOrderLineElement that returns the this value

        if  Set_DisplayLine2('Set from OnReceiveOnAfterSetFromAnyLine');

          // Under-/OverDeliveryValidation - The choices are: None, Warn, Block
          Set_UnderDeliveryValidation('None');
          Set_OverDeliveryValidation('None');

          Item.Get(Get_ItemNumber());
          SetValue('SpecialEquimentCode', Item."Special Equipment Code");
     end;
end;

 

Example: Sort lines by custom tag

(Item."Special Equipment Code" <> ''then begin
            _BaseOrderLineElement.Set_DisplayLine5('Using special equipment is mandatory');
            _BaseOrderLineElement.SetValue('SpecialequipmentCode''SpecialequipmentCode: ' + Item."Special Equipment Code");
        end else begin
            _BaseOrderLineElement.Set_DisplayLine5('');
            _BaseOrderLineElement.SetValue('SpecialEquipmentCode''');
        end;
    end;

Example 2: Sorting order lines by Quantity


    [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOB WMS ReceivePick",  'OnGetReceiveOrderLinesOnGetPickOrderLines_OnAfterSetFromAnyLine',  '', true, true)]
    localprocedure OnGetReceiveOrderLines My2aOnGetPickOrderLines_OnAfterSetFromAnyLine(_RecRef:  RecordRef;  var  _BaseOrderLineElement:  Record  "MOB Ns BaseDataModel Element")
    var
      Item: Record Item  MobToolbox: Codeunit "MOB Toolbox";
begin
     with   _LineElement do begin  Quantity: Decimal;
          // New custom tagbegin
          Item.Get(Get_ItemNumberQuantity := MobToolbox.Text2Decimal(_BaseOrderLineElement.Get_Quantity());
          SetValue('SpecialEquimentCode', Item."Special Equipment Code");          // Sort by custom tag
          _BaseOrderLineElement.Set_Sorting1(GetValue('SpecialEquimentCode'Round(Quantity, 1));
     end;
end


Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "orderlines" and label = "example" and label = "onaftersetfrom"

...