Warning | ||
---|---|---|
| ||
Event was refactored for MOB5.14 (new parameters and event renamed), please see: |
...
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 DataMOB WMS Reference Data", 'OnGetReferenceData_OnAfterCreateHeaderConfigurations', '', true true, true true)]
local procedure OnGetReferenceData OnGetReferenceData_OnAfterCreateHeaderConfigurations(var _HeaderConfigurationElement: Record "MOB RefD HeaderConfig ElementMOB RefD HeaderConfig Element")
begin
with _HeaderConfigurationElement do begin
_HeaderConfigurationElement.Create('MyNewConfigurationKey'); // Identifier for new ConfigurationKey - replace by your own key name Identifier for new ConfigurationKey - replace by your own key name
// Add headerConfiguration elements here
Add headerConfiguration elements here
// ...
end ;
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
with _HeaderConfigurationElement do begin
Create('CustomPrintLabel'); // New ConfigurationKey
AddPrintLabelHeaderValues(_HeaderConfigurationElement);
end;
end;
local procedure AddPrintLabelHeaderValues(var _HeaderConfiguration: Record "MOB RefD HeaderConfig Element")
var
MobWmsLanguage: Codeunit "MOB WMS Language";
MobBaseToolBox: Codeunit "MOB Toolbox";
begin
with _HeaderConfiguration do begin
// Add the header lines
// Item
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
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
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
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
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;
end;
Version History
Version | Changes |
---|---|
MOB5.00 | Introduced |
...