Use this event to
Populate warehouse journal line when posting unplanned move with Location."Directed Put-away and Pick"
This event is triggered only when Item Journal Posting is skipped from MobSetup."Skip Whse. Unpl. Count Item Journal Post" (meaning, setup value is "true").
When Item Journal Posting is enabled (not skipped) an Item Journal Line is used for the posting process and will only indirectly create Warehouse Journal Lines during the process - and only when location is "Bin Mandatory". In this case:
- You must subsribe to OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine to populate the Item Journal Line
- Additionally you may subscribe to "WMS Managment"."OnAfterCreateWhseJnlLine()" to handle values not being assigned from the standard "WMS Management."CreateWhseJnlLine"() function.
See also: OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine
Template : Item Journal Posting is disabled
//
// Item Journal Posting is disabled (MobSetup."Skip Whse Unpl Count IJ Post" = true)
//
// [Template] 01 - Item Journal Posting is disabled (MobSetup."Skip Whse Unpl Count IJ Post" = true)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateWhseJnlLine', '', true, true)]
local procedure OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateWhseJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _WhseJnlLine: Record "Warehouse Journal Line")
begin
end;
Template : Item Journal Posting is enabled
//
// Item Journal Posting is enabled (MobSetup."Skip Whse Unpl Count IJ Post" = false)
//
// [Template] 02 - Item Journal Posting is enabled (MobSetup."Skip Whse Unpl Count IJ Post" = false)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine', '', true, true)]
local procedure OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLine: Record "Item Journal Line")
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"WMS Management", 'OnAfterCreateWhseJnlLine', '', true, true)]
local procedure OnAfterCreateWhseJnlLine(ItemJournalLine: Record "Item Journal Line"; var WhseJournalLine: Record "Warehouse Journal Line"; ToTransfer: Boolean)
begin
end;
Example : Item Journal Posting is disabled
//
// Item Journal Posting is disabled (MobSetup."Skip Whse Unpl Count IJ Post" = true)
//
// [Example] 01 - Item Journal Posting is disabled (MobSetup."Skip Whse Unpl Count IJ Post" = true)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateWhseJnlLine', '', true, true)]
local procedure MyOnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateWhseJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _WhseJnlLine: Record "Warehouse Journal Line")
var
RegistrationType: Text;
ItemNo: Text;
LocationCode: Text;
BinCode: Text;
begin
RegistrationType := _RequestValues.GetValue('RegistrationType');
ItemNo := _RequestValues.GetValue('Item');
LocationCode := _RequestValues.GetValue('Location');
BinCode := _RequestValues.GetValue('Bin');
_WhseJnlLine.Validate(Description, CopyStr(StrSubstNo('%1 %2 at %3 %4', RegistrationType, ItemNo, LocationCode, BinCode), 1, MaxStrLen(_WhseJnlLine.Description)));
end;
Example : Item Journal Posting is enabled
//
// Item Journal Posting is enabled (MobSetup."Skip Whse Unpl Count IJ Post" = false)
//
// [Example] 02 - Item Journal Posting is enabled (MobSetup."Skip Whse Unpl Count IJ Post" = false)
// Note: Using ItemJnlLine-subscriber to populate ItemJnlLine, then standard event OnAfterCreateWhseJnlLine() to populate fields not handled by the standard BC code.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine', '', true, true)]
local procedure MyOnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine(var _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLine: Record "Item Journal Line")
var
RegistrationType: Text;
ItemNo: Text;
LocationCode: Text;
BinCode: Text;
begin
RegistrationType := _RequestValues.GetValue('RegistrationType');
ItemNo := _RequestValues.GetValue('Item');
LocationCode := _RequestValues.GetValue('Location');
BinCode := _RequestValues.GetValue('Bin');
_ItemJnlLine.Validate(Description, CopyStr(StrSubstNo('%1 %2 at %3 %4', RegistrationType, ItemNo, LocationCode, BinCode), 1, MaxStrLen(_ItemJnlLine.Description)));
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"WMS Management", 'OnAfterCreateWhseJnlLine', '', true, true)]
local procedure MyOnAfterCreateWhseJnlLine(ItemJournalLine: Record "Item Journal Line"; var WhseJournalLine: Record "Warehouse Journal Line"; ToTransfer: Boolean)
begin
WhseJournalLine.Description := CopyStr('WhseExtended ' + ItemJournalLine.Description, 1, MaxStrLen(WhseJournalLine.Description));
end;
More examples
There are no items with the selected labels at this time.
Version History
Version | Changes |
---|---|
MOB5.17 | Introduced |