Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Wrong code example

Use this event to

Excerpt

Populate fields at Warehouse Shipment Header when posting ToteShipping.


Template

        //   [Template]
        [EventSubscriber(ObjectType::Codeunit,   Codeunit::"MOB WMS Adhoc RegistrMOB WMS Adhoc Registr.",  'OnPostAdhocRegistrationOnToteShipping_
OnHandleRegistrationForWarehouseShipmentLineOnBeforeModifyWarehouseShipmentHeader',   '',  truetrue,  truetrue)]
        local procedure OnPostAdhocRegistrationOnToteShipping OnPostAdhocRegistrationOnToteShipping_OnHandleRegistrationForWarehouseShipmentLineOnBeforeModifyWarehouseShipmentHeader(var  _RegistrationRequestValues:  Record  "MOB WMS RegistrationMOB NS Request Element";  var  _RequestValues: Record "MOB NS Request Element"; var _WhseShptLine: Record "Warehouse Shipment Line")
    begin
    end;
ToteFilter: Text; var _WhseShptHeader: Record "Warehouse Shipment Header")
    begin
    end;
 

Example


        //   [Example]
   
     [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOB WMS Adhoc RegistrMOB WMS Adhoc Registr.",  'OnPostAdhocRegistrationOnToteShipping_OnHandleRegistrationForWarehouseShipmentLineOnBeforeModifyWarehouseShipmentHeader',  '',  truetrue,  truetrue)]
        local procedure MyOnPostAdhocRegistrationOnToteShipping MyOnPostAdhocRegistrationOnToteShipping_OnHandleRegistrationForWarehouseShipmentLineOnBeforeModifyWarehouseShipmentHeader(var  _RegistrationRequestValues:  Record  "MOB WMS RegistrationMOB NS Request Element";  var  _RequestValues: Record "MOB NS Request Element"; var _WhseShptLine: Record "Warehouse Shipment Line")
    var
        WhseShptHeader: Record "Warehouse Shipment Header";
        RegistrationType: Text;
    begin
        RegistrationType := ToteFilter: Text; var _WhseShptHeader: Record "Warehouse Shipment Header")
    var
        ShippingAgentCode: Code[10];
        ShippingAgentServiceCode: Code[10];
    begin
        // prerequisite: the "ShippingAgentCode"- and "ShippingAgentServiceCode"-steps must to be created from separate event to be able to actually read this value here
        // see: https://docs.taskletfactory.com/display/TFSK/OnGetRegistrationConfiguration_OnAddSteps
        ShippingAgentCode := CopyStr(_RequestValues.GetValue('RegistrationTypeShippingAgentCode');
        WhseShptHeader.Get(_WhseShptLine."No.");
        _WhseShptLine."Description 2" := CopyStr(StrSubstNo('%1 %2 %3', RegistrationType, _Registration."Tote ID", WhseShptHeader."MOB Posting MessageId")1, MaxStrLen(_WhseShptLine."Description 2"));
    end;

...

, 1, MaxStrLen(ShippingAgentCode));
        ShippingAgentServiceCode := CopyStr(_RequestValues.GetValue('ShippingAgentServiceCode'), 1, MaxStrLen(ShippingAgentServiceCode));

        _WhseShptHeader.Validate("Shipping Agent Code", ShippingAgentCode);
        _WhseShptHeader.Validate("Shipping Agent Service Code", ShippingAgentServiceCode);
    end;


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


Version History

Version

Changes

MOB5.17Introduced