[Removed]OnGetReferenceData_OnAfterCreateHeaderConfigurations (v5.00-5.13)
Removed since MOB5.14
Event was refactored for MOB5.14 (new parameters and event renamed), please see:
(Legacy) How-to: Solve breaking changes in MOB 5.14
Use this event to
Define a new Header and it's filters.
The header fields are the first thing the user sees when using any function.
Parameters
- "var _HeaderConfigurationElement" is already populated temporary table with the standard functions.
Always call _HeaderConfigurationElement.Create(...) prior to populating a key to avoid overriding existing from standard Mobile WMS or keys created from other event subscribers.
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAfterCreateHeaderConfigurations', '', true, true)]
local procedure OnGetReferenceData_OnAfterCreateHeaderConfigurations(var _HeaderConfigurationElement: Record "MOB RefD HeaderConfig Element")
begin
_HeaderConfigurationElement.Create('MyNewConfigurationKey'); // Identifier for new ConfigurationKey - replace by your own key name
// Add headerConfiguration elements here
// ...
;
end;
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAfterCreateHeaderConfigurations', '', true, true)]
local procedure OnGetReferenceData_OnAfterCreateHeaderConfigurations(var _HeaderConfigurationElement: Record "MOB RefD HeaderConfig Element")
begin
_HeaderConfigurationElement.Create('CustomPrintLabel'); // New ConfigurationKey
_HeaderConfigurationElement.AddPrintLabelHeaderValues(_HeaderConfigurationElement);
end;
local procedure AddPrintLabelHeaderValues(var _HeaderConfiguration: Record "MOB RefD HeaderConfig Element")
var
MobWmsLanguage: Codeunit "MOB WMS Language";
MobBaseToolBox: Codeunit "MOB Toolbox";
begin
// Add the header lines
// Item
_HeaderConfiguration.Add_TextValue(
1, //id
'ItemNumber', //name
CopyStr(MobWmsLanguage.GetMessage('ITEM') + ':', 1, 100), //label
100, //label width
true, //clear on clear
true, //accept barcode
20, //length
false, //optional
'ItemSearch', //search type
CopyStr(MobBaseToolbox.GetItemNoGS1Ai(), 1, 30), //ean GS1Ai
false); //locked
// Lot Number
_HeaderConfiguration.Add_TextValue(
2, //id
'LotNumber', //name
CopyStr(MobWmsLanguage.GetMessage('LOT_NO_LABEL') + ':', 1, 100), //label
100, //label width
true, //clear on clear
true, //accept barcode
20, //length
false, //optional
'', //search type
CopyStr(MobBaseToolbox.GetLotNoGS1Ai(), 1, 30), //ean GS1Ai
false); //locked
// Expiration Date
_HeaderConfiguration.Add_DateValue(
3, //id
'ExpirationDate', //name
CopyStr(MobWmsLanguage.GetMessage('EXP_DATE_LABEL') + ':', 1, 100), //label
100, //label width
false, //clear on clear
true, //accept barcode
0D, //min date
0D, //max date
false, //optional
CopyStr(MobBaseToolbox.GetExpirationDateGS1Ai(), 1, 30)); //ean GS1Ai
// Quantity
_HeaderConfiguration.Add_IntegerValue(
4, //id
'Quantity', //name
CopyStr(MobWmsLanguage.GetMessage('QUANTITY') + ':', 1, 100), //label
100, //label width
true, //clear on clear
true, //accept barcode
0, //minValue
1000000, //maxValue
false, //optional
CopyStr(MObBaseToolbox.GetQuantityGS1Ai(), 1, 30)); //ean GS1Ai
// Number of Labels
_HeaderConfiguration.Add_IntegerValue(
5, //id
'NumberOfLabels', //name
CopyStr(MobWmsLanguage.GetMessage('PRINT_QTY') + ':', 1, 100), //label
100, //label width
true, //clear on clear
false, //accept barcode
0, //minValue
5, //maxValue
false, //optional
''); //eanAi
end;
Version History
Version | Changes |
---|---|
MOB5.00 | Introduced |